1

Hi I am trying to create a formula field that will provide a geography field based on the value of one or more fields. I currently get the followign error

Error:

Incorrect number of parameters for function 'IF()'. Expected 3, received 2

Formula

IF(
AND(
OppRegion__c = "EMEA",
IF(Account_Country__c = "Azerbaijan","Middle East",
IF(Account_Country__c = "Bahrain", "Middle East",
IF(Account_Country__c = "Iraq", "Middle East",
IF(Account_Country__c = "Israel", "Middle East",
IF(Account_Country__c = "Jordan", "Middle East",
IF(Account_Country__c = "Kuwait", "Middle East",
IF(Account_Country__c = "Lebanon", "Middle East",
IF(Account_Country__c = "Palestine", "Middle East",
IF(Account_Country__c = "Qatar", "Middle East",
IF(Account_Country__c = "Saudi Arabia", "Middle East",
IF(Account_Country__c = "Turkey", "Middle East",
If(Account_Country__c = "Russia", "Russia",
If(Account_Country__c = "Russian Federation","Russia",
If(Account_Country__c = "UAE","Middle East",
If(Account_Country__c = "United Arab Emirates","Middle East",
IF(Account_Country__c = "yemen", "Middle East"),
If(
AND(
OppRegion__c = "APAC",
IF(
CONTAINS(
Account_Country__c, "China"),"China",
If(Account_Country__c = "Japan","Japan",
If(Account_Country__c = "JP","Japan",
If(Account_Country__c = "Macau","China",
If(Account_Country__c = "Vietnam","Vietnam",
If(Account_Country__c = "KR","South Korea",
If(
CONTAINS(
Account_Country__c, "Korea","South Korea"),
IF(
OppRegion__c = "NAM", "North America",
IF(OppRegion__c = "ROW", "SOUTH AMERICA","Other"))))))))))))))))))))))))))))
  • 1
    Problem is described by the error, you have not provided enough parameters to one or more IF statement(s) in there somewhere. Use a text editor and break them out ensuring each IF contains a value test, and true part, and a false part. – Eric Jul 9 '15 at 2:31
  • Formulas like this case be made a bit easier to understand and a bit shorter by using the CASE function. – Keith C Jul 9 '15 at 8:25
2
IF( 
AND( OppRegion__c = "EMEA", 
IF(Account_Country__c = "Azerbaijan","Middle East", 
IF(Account_Country__c = "Bahrain", "Middle East", 
IF(Account_Country__c = "Iraq", "Middle East", 
IF(Account_Country__c = "Israel", "Middle East", 
IF(Account_Country__c = "Jordan", "Middle East", 
IF(Account_Country__c = "Kuwait", "Middle East", 
IF(Account_Country__c = "Lebanon", "Middle East", 
IF(Account_Country__c = "Palestine", "Middle East", 
IF(Account_Country__c = "Qatar", "Middle East", 
IF(Account_Country__c = "Saudi Arabia", "Middle East", 
IF(Account_Country__c = "Turkey", "Middle East", 
If(Account_Country__c = "Russia", "Russia", 
If(Account_Country__c = "Russian Federation","Russia", 
If(Account_Country__c = "UAE","Middle East", 
If(Account_Country__c = "United Arab Emirates","Middle East", 
IF(Account_Country__c = "yemen", "Middle East"), 
If( AND( OppRegion__c = "APAC", 
IF( CONTAINS( Account_Country__c, "China"),"China", 
If(Account_Country__c = "Japan","Japan", 
If(Account_Country__c = "JP","Japan", 
If(Account_Country__c = "Macau","China", 
If(Account_Country__c = "Vietnam","Vietnam", 
If(Account_Country__c = "KR","South Korea", 
If( CONTAINS( Account_Country__c, "Korea","South Korea"), 
IF( OppRegion__c = "NAM", "North America", 
IF(OppRegion__c = "ROW", "SOUTH AMERICA","Other"))))))))))))))))))))))))))))

I think the problem is in IF(Account_Country__c = "yemen", "Middle East") where only two parameters are passed. Remove the closing )

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.