Help

Use IF to return results with many conditions

Topic Labels: Formulas
835 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Lucas_Vieira
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi guys

I’m trying to use the formula IF to return some values. This is my example:

I have 4 conditions, wich are the number of words that a text must have:

  • 500 words
  • 1000 words
  • 2000 words
  • 2500 words

And to each one I have a specific value

  • To 500 return 30
  • To 1000 return 45
  • To 2000 return 55
  • T0 2500 return 70

I tried to use the formula that I use in Google Sheets: =IF({number of words}=500;30;IF({number of words}=1000;45;IF({number of words}=2000;55)))

I tried to use this way but it returns error. How could I use this formula in my case?

2 Replies 2
Zollie
10 - Mercury
10 - Mercury

The Airtable syntax is a little different, but they’re nearly identical.
IF({number of words}=500,30,IF({number of words}=1000,45,IF({number of words}=2000,55)))

Here’s that code refactored:
SWITCH(LEN({words}),500,30,1000,45,2000,55)

Lucas_Vieira
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks, Zollie.

It worked! :slightly_smiling_face: