Formula field for Calculating contract value less than 12 months - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Karin McWilliamsKarin McWilliams 

Formula field for Calculating contract value less than 12 months

Hi All - 

We went from having 12 month contracts to 3 and 6 month contracts and my calculation was based on 12 months only.
How can I calculate annual contract value for only 3 or 6 months along with the 12 month contract?

Below is my original formula field:
Contract_Total_Value__c  / Contract_Term_Number__c * 12
Best Answer chosen by Karin McWilliams
Karin McWilliamsKarin McWilliams
OK I think I've got it:
IF( Contract_Term_Number__c = 3, Contract_Total_Value__c  / Contract_Term_Number__c * 3,
IF( Contract_Term_Number__c = 6, Contract_Total_Value__c  / Contract_Term_Number__c * 6,
IF( Contract_Term_Number__c = 12, Contract_Total_Value__c  / Contract_Term_Number__c * 12, NULL)))

All Answers

Ahilesh RagavanAhilesh Ragavan
Hi Karin,

Try like these:

3 Month Contract -
Contract_Total_Value__c  / Contract_Term_Number__c * 4

6 Month Contract -
Contract_Total_Value__c  / Contract_Term_Number__c * 6
Karin McWilliamsKarin McWilliams
Thanks for the quick answer, Ahilesh!
I need the formula to calculate into one field so I need an IF statement. Doy ou know how I would do this?
Karin McWilliamsKarin McWilliams
Like this?
IF( Contract_Term_Number__c = 3, Contract_Total_Value__c  / Contract_Term_Number__c * 3)
IF( Contract_Term_Number__c = 6, Contract_Total_Value__c  / Contract_Term_Number__c * 6)
IF( Contract_Term_Number__c = 12, Contract_Total_Value__c  / Contract_Term_Number__c * 12), NULL
Karin McWilliamsKarin McWilliams
OK I think I've got it:
IF( Contract_Term_Number__c = 3, Contract_Total_Value__c  / Contract_Term_Number__c * 3,
IF( Contract_Term_Number__c = 6, Contract_Total_Value__c  / Contract_Term_Number__c * 6,
IF( Contract_Term_Number__c = 12, Contract_Total_Value__c  / Contract_Term_Number__c * 12, NULL)))
This was selected as the best answer
Narender SinghNarender Singh
Why not simply like this?
Contract_Total_Value__c  / Contract_Term_Number__c * Contract_Term_Number__c

 
Steve MolisSteve Molis
+++  I would go with @NarenderSingh 's soluation (it's MUCH cleaner)