Skip to main content
Question

Nesting more than 2 IF statements in formula

  • Oct 25, 2026 5:11 PM UTC
  • 8 replies
  • 121 views

elmiam

I am having trouble nesting 6 IF statements. It allows me to do so and save it, but when I click back in, only the first two IFs appear – the rest of have erased. Here’s what the formula looks like when I click back in:

 

IF({CS} < 14,

 0,

 IF({CS} > 13,

   AND({CS} < 17),

   1)

)

 

^ When this happens, the formula is working – but only for what’s showing up. The other four IFs I want in play are:

 

 IF({CS} > 16,

   AND({CS} < 20),

   2

 

 

 IF({CS} > 19,

   AND({CS} < 23),

   3

 

 

 IF({CS} > 22,

   AND({CS} < 20),

   4

 

 

 IF({CS} > 25,

   5

 

 

Any tips? I have read a lot of other community posts and guidelines, but I am not seeing this same problem come up anywhere – where it seems to work, but not quite. Thanks!

8 replies

Nick_Gatens
Forum|alt.badge.img
  • Participating Frequently
  • Oct 25, 2026 5:26 PM UTC

One of the nice things about nested IFs is that they are evaluated in order, so you can likely structure this so that you don’t need all the AND statements.

So if I’m reading your intent correctly, you could probably get to something like:

IF({CS} < 14, 0,
IF({CS} < 17, 1,
IF({CS} < 20, 2,
IF({CS} < 23, 3,
IF({CS} < 26, 4, 5)))))

 

If it’s less than 14, returns 0
If it’s less than 17 (but 14 or above because it didn’t pass the first IF), returns 1,
etc. all the way to returns 5 if it didn’t pass all the other IFs (meaning it’s 26 or higher!)


VikasVimal
Forum|alt.badge.img+12
  • Inspiring
  • Oct 25, 2026 11:16 PM UTC

The issue is the formula structure, not the number of IF statements. Each IF() needs a condition, a true result, and a false result. And you only need 5 If statements for 6 outputs.

Use this:

IF({CS}<14,0,
IF({CS}<17,1,
IF({CS}<20,2,
IF({CS}<23,3,
IF({CS}<26,4,5)))))

No AND() is needed because each IF checks the next range in sequence automatically.

I also corrected your fourth condition (>22 and <20), which could never be true.


Alexey_Gusev
Forum|alt.badge.img+25

JFYI, you can use implicit conversion from BOOLEAN to NUMBER, where TRUE=1/FALSE=0
However, I would use solutions from above, as “better readable”
 

(CS>13)+(CS>16)+(CS>19)+(CS>22)+(CS>25)

 


Vadim Ciobanu
Forum|alt.badge.img+2
  • Known Participant
  • Oct 31, 2026 5:37 PM UTC

To add to the solutions above, here’s why your original version kept “losing” the extra IFs. In Airtable, IF() takes exactly three parts: IF(condition, value_if_true, value_if_false). In your formula:

IF({CS} > 13, AND({CS} < 17), 1)

AND({CS} < 17) isn’t joined to the condition. It’s sitting in the value_if_true slot, and 1 is the value_if_false. That IF is already complete, so there was no slot left for the next ones. If you want to keep the explicit ranges, the AND has to wrap both checks:

IF(AND({CS} > 13, {CS} < 17), 1, ...)

One more thing worth handling: with the formulas above, an empty CS returns 0, because blank is treated as 0, which looks like a real score. Wrapping it keeps empty rows empty:

IF(LEN({CS} & "") = 0, BLANK(),
IF({CS} < 14, 0,
IF({CS} < 17, 1,
IF({CS} < 20, 2,
IF({CS} < 23, 3,
IF({CS} < 26, 4, 5))))))

Resulting ranges (your 4th condition had > 22 and < 20, so double-check this matches what you meant):

CS Result
below 14 0
14–16 1
17–19 2
20–22 3
23–25 4
26+ 5
empty empty

Alexey_Gusev
Forum|alt.badge.img+25

Formulas in Airtable can be more flexible.
IF can be  IF(condition, value_if_true)
Checking for “emptiness” can be IF({Field Name}, ….  
Brackets can be omitted for one-word Field name. 
Example:
 


 


VedaSync_Aziz
Forum|alt.badge.img+2
  • Participating Frequently
  • Nov 3, 2026 8:23 AM UTC

One thing to check: your saved formula only looks like it’s working.

In IF({CS} > 13, AND({CS} < 17), 1), the AND sits in the “if true” slot, so its result is the answer. That’s why 14 to 16 show 1. But from 17 up the AND is false, so those rows show 0, the same as a score under 14.

Try a row with a CS of 18. If it shows 0, recheck anything that uses this field once the new formula is in.


greg_business_automated
Forum|alt.badge.img

You could also  brute force your way a bit with IF+ Switch , not shorter but readable!

IF({CS} < 14, 0,
  IF({CS} >= 26, 5,
    SWITCH(INT({CS}),
      14, 1, 15, 1, 16, 1,
      17, 2, 18, 2, 19, 2,
      20, 3, 21, 3, 22, 3,
      23, 4, 24, 4, 25, 4
    )
  )
)


Alexey_Gusev
Forum|alt.badge.img+25

Or you can use other type of math and the fact your choice having 3 numbers for each option

 

IF(CS<14, 0, IF(CS >= 26, 5,
INT((CS-11)/3))
)