0

Hi friends i have formul ain custom object and i am try to group based on a number field.But i am gettig error like ,

Please help my validation rule.

IF(Net_Promoter_Score__c < 7, "Detractor"), IF(Net_Promoter_Score__c > 8, 
                                                "Promoter"), "Passive"))

I'm getting error like

Error: Syntax error. Extra ','

2 Answers 2

4

You misplaced some parentheses, which confused the compiler. Here's the correct version:

IF(Net_Promoter_Score__c < 7, "Detractor", 
  IF(Net_Promoter_Score__c > 8, "Promoter", "Passive"))

Generally speaking, if you have a different number of ( and ) in a formula, then you have a mistake somewhere. In your original formula, you had 2 ( and 4 ), which was incorrect.

If statements are in the form IF(Condition, TrueValue, FalseValue). When you need to chain them together, they take place of the TrueValue/FalseValue places, like this:

If(Condition, 
  If(Condition, TrueValue, FalseValue), 
  If(Condition, TrueValue, FalseValue)
)

Just remember that the left and right parentheses should always match.

0

Try this,

IF(Net_Promoter_Score__c < 7, "Detractor",IF(Net_Promoter_Score__c > 8,"Promoter","Passive"))

You must log in to answer this question.

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