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
Whitney YorstonWhitney Yorston 

Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 1

I am trying to write a formula that if ME and Resubmission is True (it's a checkbox), then it will give me 45, if ME and Resubmission is False , then it will give me 90,  if NOT ME and Resubmission is True , then it will give me 75, and  if NOT ME and Resubmission is False , then it will give me 145. I'm getting the error:   Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 1. Any help is appreciated, the formula is below!

IF(AND(IF(Account.BillingState = 'ME'),IF(Resubmission__c = '1')),45,AND(IF(Account.BillingState = 'ME'),IF(Resubmission__c= '0')),90,AND(IF(Account.BillingState <> 'ME'),IF(Resubmission__c = '1')),75,AND(IF(Account.BillingState <> 'ME'),IF(Resubmission__c = '0')),145)
Best Answer chosen by Whitney Yorston
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Whitney,

Can you try below logic.
 
IF(AND(Account.BillingState = 'ME',Resubmission__c = '1'),45,

IF(AND(Account.BillingState = 'ME',Resubmission__c= '0'),90 , 
IF(AND(Account.BillingState <> 'ME',Resubmission__c = '1'),75,
IF(AND(Account.BillingState <> 'ME',Resubmission__c = '0'),145,0
))))

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Whitney,

Can you try below logic.
 
IF(AND(Account.BillingState = 'ME',Resubmission__c = '1'),45,

IF(AND(Account.BillingState = 'ME',Resubmission__c= '0'),90 , 
IF(AND(Account.BillingState <> 'ME',Resubmission__c = '1'),75,
IF(AND(Account.BillingState <> 'ME',Resubmission__c = '0'),145,0
))))

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
This was selected as the best answer
Whitney YorstonWhitney Yorston
Hello! Thank you!! Though now I'm getting this error: Error: Incorrect parameter type for operator '='. Expected Boolean, received Text Whitney Whitney Yorston CRM System Support Professional University of Maine Cooperative Extension
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Whitney,

Is Resubmission__c a checkbox field?

Thanks,
 
Whitney YorstonWhitney Yorston
Yes, once I changed it all over to True or False I got it!! 


Thank you SO much!!