Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jun 02, 2023 09:08 AM
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!
Solved! Go to Solution.
Jun 02, 2023 09:27 AM
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!
Jun 02, 2023 09:18 AM - edited Jun 02, 2023 09:27 AM
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
Jun 02, 2023 09:25 AM
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!
Jun 02, 2023 09:27 AM
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!