Skip to main content
I am currently using the following formula to calcluate the months between 2 dates:

 

TEXT((YEAR( Renewal_Policy_Date_Ends__c)*12+MONTH(Renewal_Policy_Date_Ends__c )+1)-

 

(YEAR( Renewal_Policy_Start_Date__c)*12+MONTH(Renewal_Policy_Start_Date__c )))

 

However, the calcluation is wrong with the day is not the 1st... I have a record that has the

 

Renewal_Policy_Start_Date__c as 12/15/11 and the Renewal_Policy_Date_Ends__c as 12/14/12.. my calculated field shows 13 instead of 12.

 

Any help would be greatly appreciated!!!

 

Thanks!!

 

Fred
9 answers
  1. Mar 25, 2016, 6:30 PM
    I know that this is an older question, but I ran into a similar issue where I was looking to calculate the number of months between 2 dates (Today and Contract End Date). The above solutions were not detailed enough as they didn't take the exact day into consideration.  I have developed a formula that should output the number of months between 2 dates using the exact date.  There would be a way to combine this into one whole IF statement, but it was easier to develop in split IF statements.

     

     

    IF(Apttus__Contract_End_Date__c - TODAY () >=365,

    12 * ((YEAR(Apttus__Contract_End_Date__c)- YEAR(TODAY()))-

    IF(MONTH(Today())= MONTH(Apttus__Contract_End_Date__c),

    IF(DAY(TODAY()) > DAY(Apttus__Contract_End_Date__c),1,0),

    IF(MONTH(TODAY()) < MONTH(Apttus__Contract_End_Date__c), 0, 1))),0)

    +

    IF(MONTH(TODAY()) = MONTH(Apttus__Contract_End_Date__c),

    IF(DAY(TODAY()) <= DAY(Apttus__Contract_End_Date__c), 0, 13),0)

    +

    IF(MONTH(TODAY()) > MONTH(Apttus__Contract_End_Date__c),

    12-(MONTH(TODAY()) - MONTH(Apttus__Contract_End_Date__c))

    +

    IF(DAY(TODAY()) < DAY(Apttus__Contract_End_Date__c),1, 0),0)

    +

    IF(MONTH(TODAY()) < MONTH (Apttus__Contract_End_Date__c),

    (MONTH(Apttus__Contract_End_Date__c) - MONTH(TODAY()))

    +

    IF(DAY(TODAY()) >= DAY(Apttus__Contract_End_Date__c), 0, 1),0)

     

     
0/9000