Created
November 17, 2014 07:35
-
-
Save lkatney/885837a48c5773f3beac to your computer and use it in GitHub Desktop.
Formula to calculate n months from date and give actual date - Salesforce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATE(YEAR(DATEVALUE(Custom_date_field__c)),MONTH(DATEVALUE(Custom_date_field__c)),DAY(DATEVALUE(Custom_date_field__c))) - VALUE(TEXT(DATE(YEAR(DATEVALUE(Custom_date_field__c)),MONTH(DATEVALUE(Custom_date_field__c)),1) - DATE(IF(MONTH(DATEVALUE(Custom_date_field__c))+ 3 <= 12 ,YEAR(DATEVALUE(Custom_date_field__c)) , YEAR(DATEVALUE(Custom_date_field__c))+ 1), IF(MONTH(DATEVALUE(Custom_date_field__c))+ 3 <= 12 , MONTH(DATEVALUE(Custom_date_field__c))+ 3,MONTH(DATEVALUE(Custom_date_field__c))+ 3 - 12),1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment