Here is the current formula:

    (Line_Level_Detail__c ='Services'), Line_Level_Type__c= 'New Product'), UnitPrice   * Quantity , 0)

Trying to add criteria that says if the Opportunity Stage is Closed Lost then the results should be 0.

This formula sits on the opportunity product.

This is what I have right now:

IF(ISPICKVAL(Opportunity.StageName, "Closed Lost"), 0,  AND
    (Line_Level_Detail__c ='Services'), Line_Level_Type__c= 'New Product'), UnitPrice   * Quantity , 0)

Can't figure out where we are going wrong.

  • Taking some time to break up longer lines (onto separate lines) and indenting is usually a good way to start debugging. It's hard to convey in a comment due to formatting restrictions so, instead, look at Adrian's answer on this question for an example of what I'm talking about.
    – Derek F
    Apr 24, 2020 at 2:47

1 Answer 1


The three parameters in the IF formulas represent:

  1. logical condition
  2. value if the condition is true
  3. value if the condition is false

Since 0 was the third parameter in your original formula, you can just add another condition to the AND in the original version. Something like the following should return the expected result.

IF(AND(NOT(Line_Level_Detail__c ='Services'), Line_Level_Type__c= 'New Product', NOT(ISPICKVAL(Opportunity.StageName, 'Closed Lost'))), UnitPrice   * Quantity , 0)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .