Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

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

Topic Labels: Formulas
Solved
Jump to Solution
1404 3
cancel
Showing results for 
Search instead for 
Did you mean: 
epetrack
4 - Data Explorer
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
Stephen_Orr1
10 - Mercury
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!

See Solution in Thread

3 Replies 3
Stephen_Orr1
10 - Mercury
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

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!

 
Stephen_Orr1
10 - Mercury
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!