# IF AND based on an input + or -

✭✭✭✭

I can get this to work and in my head it should :)

I want an "In Spec" IF… the Stage 1 Temp Verification is less than or equal to S1 Temp minus 5 AND Stage 1 Temp Verification is great than or equal to S1 Temp plus 5.

=If([Stage 1 Temp Verification]@row) <=([S1: Temp]@row + 5), ([Stage 1 Temp Verification]@row) >= ([S1: Temp]@row - 5), "In Spec", "Out of Spec"))

Tags:

• ✭✭✭✭

You need an OR statement. The formula you wrote is interpreted as this:

IF Stage1 Temp Verification <= S1: Temp +5

THEN Stage1 Temp Verification >= S1: Temp -5

Both are logic checks, which is why it returns "unparseable value."

=If(OR([Stage 1 Temp Verification]@row) <=([S1: Temp]@row + 5), ([Stage 1 Temp Verification]@row) >= ([S1: Temp]@row - 5)), "In Spec", "Out of Spec"))

• ✭✭✭✭

You need an OR statement. The formula you wrote is interpreted as this:

IF Stage1 Temp Verification <= S1: Temp +5

THEN Stage1 Temp Verification >= S1: Temp -5

Both are logic checks, which is why it returns "unparseable value."

=If(OR([Stage 1 Temp Verification]@row) <=([S1: Temp]@row + 5), ([Stage 1 Temp Verification]@row) >= ([S1: Temp]@row - 5)), "In Spec", "Out of Spec"))

• ✭✭✭✭

Getting an unparseable in return.. looks like too many parenthesis maybe?

• ✭✭✭✭

This cleans up some extraneous parens:

=If(OR([Stage 1 Temp Verification]@row <= ([S1: Temp]@row + 5), [Stage 1 Temp Verification]@row >= ([S1: Temp]@row - 5)), "In Spec", "Out of Spec")

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!