You need to sign in to do that
Don't have an account?
John Collier
formula to generate date for last day of previous month, one year later
We need the formula to generate a date for the last day of the previous month, one year from now. I have tried the formulas in posts for last day of previous month and for last day of this month one year from now, but I have not been able to modify and have the formula accepted.
For example: 4 september 2018 : one year from now = 4 september 2017 , last day of the previous month = 31 august 2017
but 2 january 2018 : one year from now = 2 january 2017 , last day of the previous month = 31 decembre 2016
One year form now will be always: YEAR (date) - 1 but previous month, will be : MONTH ( date) - 1 and if MONTH ( date ) = 0 then MONTH(date) = 12 and YEAR ( date ) - 2
With two formulas, it is easier.
1) Formula: date_previous__c :
2) Formula : Finding just the Last Day of the Month: date_last_day__c (using date_previous__c )
The easiest way to find the last day of a month is to find the first day of the next month and subtract a day.
https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=5
That's why you should give examples for: "a date for the last day of the previous month, one year from now."
For example: 4 september 2018 : one year from now = 4 september 2019 , last day of the previous month = 31 august 2019
but 2 january 2018 : one year from now = 2 january 2019 , last day of the previous month = 31 decembre 2018
One year form now will be always: YEAR (date) + 1 but previous month, will be : MONTH ( date) - 1 and if MONTH ( date ) = 0 then MONTH(date) = 12 and YEAR ( date )
With two formulas, it is easier.
1) Formula: date_previous__c :
2) Formula : Finding just the Last Day of the Month: date_last_day__c (using date_previous__c )
The easiest way to find the last day of a month is to find the first day of the next month and subtract a day.
https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=5