I have the following field below
Judgment_Events_Date__c (Date)
Years__c (number)
Judgment_Events_Date_Summary__c formula(Date) field with formula below
Years__c * 365 + Judgment_Events_Date__c
What I am trying to do is when a user selects a number in the Years__c field, I want the formula in the Judgment_Events_Date_Summary__c to calculate the exact year from the date in the Judgment_Events_Date__c field.
Currently when I select a number in the Years__c field, the dates in the fields Judgment_Events_Date__c and the Judgment_Events_Date_Summary__c does not have a range for 1 year.
Example if Judgment_Events_Date__c = 12/01/2014 the date in the Judgment_Events_Date_Summary__c field = 12/03/20, if a user enters 6 in the Years__c field.
Any solutions?
3 answers
please try the below
IF( AND( MONTH(Judgment_Events_Date__c) == 2, DAY(Judgment_Events_Date__c) == 29 ),
DATE( YEAR(Judgment_Events_Date__c) + Years__c, MONTH(Judgment_Events_Date__c) + 1, DAY(Judgment_Events_Date__c) ) - 1,
DATE( YEAR(Judgment_Events_Date__c) + Years__c, MONTH(Judgment_Events_Date__c), DAY(Judgment_Events_Date__c) ) )