function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BeachArtistBeachArtist 

Help - Need nested IF formula working by 8am EST Today!!!!

Hello, I am formula challenged and  am struggling with a formula that will calculate as follows:

IF the contract term in months is equal to or less than 12 then all of the product detail fields are added together.

BUT IF the contract term in months is greater than 12 then each of the product detail fields have to be / by 12 (to get the monthly amount) and then multiplied by the # of months. And then the set up fees added back in.


Here is what I have so far.  

 

IF( Term_of_Proposal_months__c  <= 12, Field1__c + Field2__c + Field3__c+Field4__c   , IF( Term_of_Proposal_months__c >12 , (Field1__c +  Field2__c +  Field3__c ) /12  *Term_of_Proposal_months__c+Field4_c ,))

 

Please help I am desperate

 

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
BeachArtistBeachArtist

This work perfectly. Thank you SOOO much!!!

 

Have a wonderful week

All Answers

AMartinAMartin

I'm 45 minutes late but how about this?

 

IF( 
Term_of_Proposal_months__c  <= 12,
Field1__c + Field2__c + Field3__c + Field4__c, 
(((Field1__c +  Field2__c +  Field3__c ) / 12) * Term_of_Proposal_months__c) + Field4_c
)

 

You didn't need a nested If.  The greater than 12 part of the formula is the "Else" statement.  I've added a few brackets to the else statement just to make sure the addition/division/multiplication all take place in the correct order.

 

hth

 

Aiden

BeachArtistBeachArtist

This work perfectly. Thank you SOOO much!!!

 

Have a wonderful week

This was selected as the best answer