Skip to main content
Solved

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


Forum|alt.badge.img+1

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!

 
 
 
 
 

Best answer by Stephen_Orr1

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!

View original
This topic has been closed for replies.

3 replies

Forum|alt.badge.img+18

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


Forum|alt.badge.img+1
  • Author
  • New Participant
  • June 2, 2023

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


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!

 

Forum|alt.badge.img+18

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!