function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
muralikrishna gondimuralikrishna gondi 

I have issue date in custom object and i want add another formula field to calculate 13 months from issue date

I have a field issue date in custom object and i want to add another formula field to calculate 13 months from issue date and date should be the last day of the month.
I used DATE(YEAR(ccs_IssueDate__c) +1, MONTH(ccs_IssueDate__c) + 2, 1) - 1 this formula .
But if the  issue date is in decemeber month its showing #error in formula field.

Please give me some solution..
Thank you.
Best Answer chosen by muralikrishna gondi
Jean-Noel CasassusJean-Noel Casassus
The month part of a date should be between 1 and 12. For December, the number from the function is 14.
A function like the follwing one should help you.

DATE(case(Month(DateValue(ccs_IssueDate__c)), 11, 2, 12, 2, 1)+ Year(DateValue(ccs_IssueDate__c)), case(Month(DateValue(ccs_IssueDate__c)), 12, 2, 11, 1, 2 + Month(DateValue(ccs_IssueDate__c))), 1)-1