# I am having difficulty figuring out the If statements with multiple conditions. I keep getting syntax errors.

• 0
• Question
• Updated 3 years ago

I am writing a formula for calculating Worker's Comp estimates for a pricing tool. Example is below:

IF([location - Address: State/Region] =”Alabama”) AND ([Labor/Mgmt] = ”Management”),[Annual Wages]*.0011,IF([location - Address: State/Region] =”Alabama”) AND ([Labor/Mgmt] = ”Labor”),[Annual Wages]*.012)

• 40 Points

Posted 3 years ago

• 0
• 72,448 Points
try this

IF(

[location - Address: State/Region] =”Alabama” AND [Labor/Mgmt] = ”Management”,[Annual Wages]*.0011,

[location - Address: State/Region] =”Alabama” AND [Labor/Mgmt] = ”Labor”,[Annual Wages]*.012)

note btw that this will be null if the conditions are not true.

You may actually want this

IF(

[location - Address: State/Region] =”Alabama” AND [Labor/Mgmt] = ”Management”,[Annual Wages]*.0011,

[location - Address: State/Region] =”Alabama” AND [Labor/Mgmt] = ”Labor”,[Annual Wages]*.012, 0)
• 40 Points
Thank you for the quick reply. I tried both scenarios and I am still getting a syntax error. Could it perhaps have something to do with the field types? I am creating a Formula-Numeric field (as I want it to return currency). Location is a field from the "address" function (connected via relationship), Labor/Mgmt is a drop down field from the same table, Annual Wages is a Formula-Numeric field. Thoughts?
• 72,448 Points
can you post your formula and the error?
• 40 Points
IF(

[location - Address: State/Region] =”Alabama” AND [Labor/Mgmt] = ”Management”,[Annual Wages]*.0011,

[location - Address: State/Region] =”Alabama” AND [Labor/Mgmt] = ”Labor”,[Annual Wages]*.012)

----------------------------------------------------
Formula syntax error

Expected a valid expression after the "="

IF(

[location - Address: State/Region] =  Alabama AND [Labor/Mgmt] = Management,[Annual Wages]*.0011,

[location - Address: State/Region] =Alabama AND [Labor/Mgmt] = Labor,[Annual Wages]*.012)
• 72,448 Points
The quotes around the word Alabama got copied in as the wrong kind of quotes.  Please retype them off your keyboard.  They cannot be the curly 66 99 type quotes. they need to be the quotes near the enter key.
• 40 Points
That appears to have worked. How odd. Thank you!
• 72,448 Points
Once you have been bitten by curly quotes, you don't forget. I got bit once.