0

I am trying to create a formula with several specific requirements to calculate call contact rates.

The first IF section of my formula works on its own, however adding the additional IF statements gives me this error: Warning Error when encoding row-level formula: Syntax error. Extra IF

Here is the formula I am trying to accomplish. Not sure if I need to add an ELSE statement somewhere. Any help is appreciated

IF(
    AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c=0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>0, NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c<21, NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__EndReason__c='Agent', NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Percent__c>0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Customer_Percent__c>0),
    "YES","NO")   

IF(
    AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c=0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>20, NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Percent__c>0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Customer_Percent__c>0),
    "YES","NO")

IF(
    AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c>0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>180),
    "YES","NO") 

IF(
    AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c=1,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>119,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c<180),
    "YES","NO") 
1
  • Welcome to SSE! Is your requirement such that if first condition satisfies it should be Yes or else check second ... none satisfies it should be No Commented Mar 13, 2023 at 4:53

1 Answer 1

0

The issue in your formula is you are writing multiple IF() statements but not following proper syntax. Your syntax should look like below.

IF(CHECK1, 'YES',IF(CHECK2,'YES', IF(CHECK3,'YES','NO')) )

if you implement like above then it first checks for CHECK1 and if that is satisfied it will return YES if not it goes inside second IF() and checks for CHECK2 and soon...

So your entire formula will look as below.

IF( AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c=0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>0, NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c<21, NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__EndReason__c='Agent', NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Percent__c>0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Customer_Percent__c>0), 
"YES",IF( AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c=0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>20, NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Percent__c>0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Customer_Percent__c>0), 
 "YES",IF( AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c>0,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>180),
 "YES",IF( AND(NVMStatsSF__NVM_Call_Summary__c.Voicemail_Customer_Voicemail__c=1,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c>119,NVMStatsSF__NVM_Call_Summary__c.NVMStatsSF__Agent_Talk_Time__c<180), "YES","NO")
 )
)
)
2
  • Thank you for your help, this worked.
    – Mike
    Commented Mar 13, 2023 at 14:43
  • 1
    @Mike - as a service to the community, you should mark SaiPraveen's answer as accepted using the checkmark.
    – cropredy
    Commented Mar 13, 2023 at 20:37

You must log in to answer this question.

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