• Nich Weidman 3
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have a formula that looks at the date ranges of all the Opportunity Products, finds the earliest start date and the latest end date to give the number of months in that term.  However, if the dates are around the begining of the month, sometimes it is off by one.  
 
((YEAR(Latest_End_Date__c) - YEAR(Earliest_Start_Date__c ))*12) + (MONTH(Latest_End_Date__c) - MONTH(Earliest_Start_Date__c ))
So, for example, if the earliest Start Date is 8/1/22 and the end date is 9/30/23, that will show as 13 months.  But if the start date is 8/2/22 and the end is 10/1/23, that is the same number of days but will show as 14.

Both date ranges should return 14 for our calculations, but I am unsure what tweaks to make to the formula to accomplish that.

Any help would be appreciated.
 
I have a formula that looks at the date ranges of all the Opportunity Products, finds the earliest start date and the latest end date to give the number of months in that term.  However, if the dates are around the begining of the month, sometimes it is off by one.  
 
((YEAR(Latest_End_Date__c) - YEAR(Earliest_Start_Date__c ))*12) + (MONTH(Latest_End_Date__c) - MONTH(Earliest_Start_Date__c ))
So, for example, if the earliest Start Date is 8/1/22 and the end date is 9/30/23, that will show as 13 months.  But if the start date is 8/2/22 and the end is 10/1/23, that is the same number of days but will show as 14.

Both date ranges should return 14 for our calculations, but I am unsure what tweaks to make to the formula to accomplish that.

Any help would be appreciated.