# Help with formula if from another column, then calculate...

Topic Labels: Formulas
Solved
985 3
cancel
Showing results for
Did you mean:
4 - Data Explorer

New to Airtable... Trying to create formula that will calculate 6.25% tax but ONLY if the "State" column is "MA" (for Massachusetts)... I figured out the tax part (Price*0.0625), but not getting the If State=MA, only then calculate tax for the tax column (otherwise, if not MA, just want to see 0 in the tax column).

Thanks!

1 Solution

Accepted Solutions
10 - Mercury

Oops, extra parenthesis typo in the IF formula (what I get for not testing 🙂 )
Edited my comment with the fix.

If this helped, please feel free to mark my previous comment as the solution.

Thank you!

3 Replies 3
10 - Mercury

Hi @epetrack - welcome to Airtable!
You can use an IF statement here but it's likely best to use a SWITCH statement in case you ever want to add more states.
Here is the IF version:
IF({state} = 'MA',
{Price} * 0.0625,
0)

And here is the SWITCH version:
SWITCH({State},
'MA', {Price} * 0.0625,
'NY', {Price} * 0.04,
'RI', {Price} * 0.07,
'ME', {Price} * 0.055
)

More info on formulas can be found here: https://support.airtable.com/docs/formula-field-reference

Hope that helps!
-Stephen

4 - Data Explorer

Thanks so much for the super quick reply @Stephen_Orr1 ! The IF version didn't seem to work, but the SWITCH is perfect (just put in MA for now)... again, thanks!

10 - Mercury

Oops, extra parenthesis typo in the IF formula (what I get for not testing 🙂 )
Edited my comment with the fix.

If this helped, please feel free to mark my previous comment as the solution.

Thank you!