Skip to main content

Need help with a formula to calculate months for current year revenue. 

Here’s what I have: 

IF(

    YEAR(First_Day_of_Messaging__c) = YEAR(TODAY()),

IF(

 (MONTH(First_Day_of_Messaging__c)  < Length_of_Contract__c ) , 12 - MONTH( First_Day_of_Messaging__c ),Length_of_Contract__c ),

 0

    )

Works the majority of the time.  Here’s example of one issue where this doesn’t work:

First day of messaging:  May 24, 2024

Length of Contract: 6 (months)

With my formula, I’m getting 7, which is greater than the length of contract.

What I need in a formula is:

IF(MONTH(First_Day_of_Messaging__c) <  Length_of_Contract__c, 

12-MONTH(First_Day_of_Messaging__c) unless (12-MONTH(First_Day_of_Messaging__c) is more than the length of contract, Then just give me the Length of contract

I have no idea how to get that last part in bold included in my formula.  Would greatly appreciate any help!

 

#Formula Help

2 Antworten
  1. 21. März 2024, 18:46

    Thanks @Nitika Jain, but now I'm getting 0 when the MONTH(First_Day_of_Messaging__c) is > than the Length_of_Contract__c.  

    Need this to use the Length of Contract (and not be 0). 

    Thanks so much.

0/9000