Help

The Community will be undergoing maintenance from Friday February 21 - Friday, February 29 and will be "read only" during this time. To learn more, check out our Announcements blog post.

Converting formulas from Excel to Airtable

Topic Labels: Formulas
1480 2
cancel
Showing results for 
Search instead for 
Did you mean: 
tracymf-tkk
5 - Automation Enthusiast
5 - Automation Enthusiast

I have an excel spreadsheet with many calculations.  Given my current understanding of formulas, it is very much like excel so my question is below.

Formula in Excel

=IF(SUM(N22:Q23)<>0,SUM(N22:Q23),"")

Field names in Airtable

N22= シャトル台数(Shuttle Qty)

Q23= 予備シャトル台数(Sp. Shuttle Qty)

So my airtable formula should be as follows

IF(SUM({シャトル台数(Shuttle Qty)}:{予備シャトル台数(Sp. Shuttle Qty)}<>0,SUM({シャトル台数(Shuttle Qty)}:{予備シャトル台数(Sp. Shuttle Qty)}),"")

But I keep getting an error. Where are my assumptions wrong?  It is simple addition problem

Order Qty - Shuttle
Shuttle Qty28
Spare Shuttle Qty2
Total Shuttle Qty30
2 Replies 2

Airtable formulas and Excel formulas are based on different langauges.

  • In Airtable, the "not equal to" operator is != versus <>.
  • In Airtable, there should be a comma instead of a colon between items in the SUM() function.
  • In Airtable, if you the third parameter of an IF() function is optional. Including an empty string as the third parameter will turn you result into a text string instead of a number.
  • You are also missing a closing parenthesis.

Try something like this ...

IF(
  SUM({シャトル台数(Shuttle Qty)}, {予備シャトル台数(Sp. Shuttle Qty)}) != 0,
  SUM({シャトル台数(Shuttle Qty)}, {予備シャトル台数(Sp. Shuttle Qty)})
)

 

GhostStark
4 - Data Explorer
4 - Data Explorer

in Airtable, you can't directly use a range like {シャトル台数(Shuttle Qty)}:{予備シャトル台数(Sp. Shuttle Qty)}, like you would in Excel. Instead, Airtable expects a formula to reference specific fields for calculations, so you'd need to reference them individually. Try something like:

IF(AND({シャトル台数(Shuttle Qty)} <> 0, {予備シャトル台数(Sp. Shuttle Qty)} <> 0), {シャトル台数(Shuttle Qty)} + {予備シャトル台数(Sp. Shuttle Qty)}, """")

This way, it checks if both fields are not zero and sums them. I had a similar experience trying to figure out Airtable formulas, and I remember being stuck until I found an option to show formulas in Excel, which helped me compare how Excel formulas and Airtable formulas differ.