Writing nested IF statements in Airtable
Last updated: November 4, 2026
Plan Availability | All plan types |
Permissions |
|
Platform(s) | Web/Browser, Mac app, and Windows app (with some additional limited support on mobile) |
Structuring and nesting IF statements in Airtable
On its own, an IF() function can only have two results—either the logical argument is true, or the logical argument is false. Putting an IF() function inside of another IF() function - called nesting - can make it so that your formula can output more than two responses.
IF(
Logical Argument 1,
Value 1,
IF(Logical Argument 2,
Value 2,
Value 3
)
)This function means: If “Logical Argument 1” is true, then return “Value 1.” Otherwise, if “Logical Argument 2” is true, then return “Value 2.” Otherwise, return “Value 3.”
This can be represented in a chart:

Airtable can support many, many nested IF functions, though it can become difficult difficult to track mistakes in a formula as IF functions pile on top of each other. See our formula writing tips for beginners article for more help on structuring your formulas for easy readability and troubleshooting.
Nesting IF statement example
For the example below, any student who received a test score greater than 80 will get "Exceeds expectations ✅", any student who received a test score less than 80 will get "Does not meet expectations ❌", and any student who received a test score of exactly 80 will get "Meets expectations..."
Here is the problem written out in plain language:
If the number in the {Test Score} field is greater than 80, return the text string "Exceeds expectations ✅". Otherwise, if the number in the {Test Score} field is not greater than 80, and it is less than 80, return "Does not meet expectations ❌". Otherwise, if the number in the {Test Score} field is not greater than 80, and it is also not less than 80, return "Meets expectations...".
And here is the problem written out as a formula:
IF(
{Test Score} > 80,
"✅ Exceeds expectations",
IF({Test Score} < 80,
"❌ Does not meet expectations",
"💪 Meets expectations"
)
)
Nesting three or more IF statements
In this example, a group of students have taken a test with a score out of 100 points.
If {Test Score} is less than 70 and greater than or equal to 0, return "❌ Does not meet expectations"
If {Test Score} is greater than or equal to 70, and less than 90, return "💪 Meets expectations"
If {Test Score} is greater than or equal to 90, and less than or equal to 100, return "✅ Exceeds expectations"
If the value in the{Test Score} field is somehow less than 0, or greater than 100, return "Error!"
We need to write a series of IF functions that can return all four possible outcomes, but the catch is that we can only write logical arguments with one operator—e.g., we cannot have "0<{Test Score}<70" as the logical argument in an IF. Therefore, we need to break down this problem into a series of logical arguments that have only one operator.
One way of doing this is represented by the diagram below:

The formula reflecting this series of logical arguments, therefore, looks like this:
IF(
{Test Score} < 0,
"Error!",
IF(
{Test Score} < 70,
"❌ Does not meet expectations",
IF({Test Score} < 90,
"💪 Meets expectations",
IF({Test Score} <= 100,
"✅ Exceeds expectations",
"Error!"
)
)
)
)
Bucketing a number into more than 3 ranges
Sorting a number into several ranges - score bands, price tiers, age brackets - uses the same cascading pattern as the example above, extended as far as you need. Each IF() tests one threshold with one operator, and because a branch is only reached when every test before it was false, you never have to describe the bottom of a range.
Work from the lowest threshold up, and write the thresholds in order:
List your ranges from lowest to highest, and write down only the upper bound of each one.
Write one
IF()per bound, in that order, each testing the field against that bound with a single operator.Nest each new
IF()in the previous one's false position - the third argument.Put the value for the highest range in the innermost false position, so it catches everything above the last bound.
For 6 bands of a {CS} score, that looks like this:
IF(
{CS} < 4,
"1",
IF({CS} < 8,
"2",
IF({CS} < 12,
"3",
IF({CS} < 16,
"4",
IF({CS} < 20,
"5",
"6"
)
)
)
)
)Each test only needs the upper bound because the lower bound is already guaranteed. A record that reaches the third test is known to be 8 or more, so "{CS} < 12" is enough to mean "8 to 11.99". You don't need AND() to describe the range, and adding it is a common cause of the problem described in the next section.
There aren't any hard limits on how long a formula can be, or how many IF statements can be included. However, situations where you need dozens (or more) of statements may be more simple to approach by writing a custom script instead.
When part of your formula disappears after you save it
If you save a long nested IF() formula and reopen the field to find that only the first one or two IF() functions are still there, the part that disappeared was not valid when you saved it. What remains still evaluates, so the field keeps returning values and the formula can look like it's working - it just stops short of the branches you wrote.
Two mistakes account for most of these:
AND()orOR()in the value position.AND()andOR()belong in anIF()statement's first argument, where the condition goes - not in the second or third argument, where the result goes.IF({CS} > 16, AND({CS} < 20), 2)putsAND()where a returned value should be. If you're testing two bounds of a range, you usually don't needAND()at all - see "Bucketing a number into more than 3 ranges" above.Unbalanced parentheses. Every
IF()you open needs a matching closing parenthesis, and in a nested formula those all land together at the end. Count theIF(openings, then count the closing parentheses at the end of the formula - the two numbers must match.
To recover a formula that came back short:
Copy the full formula text somewhere you can get it back - a record comment, a long text field, or a text editor - before you save it again.
Rebuild it one branch at a time, saving and checking the result after each new
IF()you add. The branch that doesn't survive a save is the one with the error.Put each
IF()on its own line, indented, with the closing parentheses stacked at the end. Formatting this way makes an unbalanced parenthesis visible rather than something you have to count.
For more error messages and what they mean, see Troubleshooting common Airtable formula errors.