+ Start a Discussion
Reach AdminReach Admin 

Need help with a Formula please!

I'm trying to create a field at the Opportunity Product level that divides the "Total Price" by the number of months in the contract (at the opp level). However, I only want it to calculate if the Product Name is not equal to "Cart".

 

IF(PricebookEntry.Product2.Name <> "Cart",TotalPrice/Opportunity.Months_in_Contract__c)

 

I keep getting an error that says I have an incorrect number of parameters for function IF(). Expected 3, received 2.

 

Any help would be very much appreciated!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
RovRov

The Syntax is

     IF(logical_test, value_if_true, value_if_false)

 

You are missing the  else part i.e value_if_condition_is_false

All Answers

RovRov

The Syntax is

     IF(logical_test, value_if_true, value_if_false)

 

You are missing the  else part i.e value_if_condition_is_false

This was selected as the best answer
Reach AdminReach Admin

Thank you very much!