# Nested IF Statements in Excel: Multiple Conditions

Excel multiple if statements are formulas where one IF function sits inside another, so Excel tests conditions in order and stops at the first one that is true. You write the first test, and the value_if_false argument becomes the next IF function instead of a plain value. This article shows the exact syntax, a worked grading example, the AND and OR alternatives, and the errors that break nested formulas most often.

## Quick Answer

- A nested IF puts a second IF function in the `value_if_false` slot of the first one, so Excel moves to the next test only when the current test fails [1].
- The syntax is `IF(logical_test, value_if_true, [value_if_false])`, and the third argument is where the nesting happens [2].
- Order matters. Excel evaluates tests left to right and returns the value for the first TRUE result, so write the strictest condition first [3].
- Excel allows up to 64 nested IF functions, but Microsoft advises against deep nesting because the formulas become hard to build, test, and update [1].
- If you have Microsoft 365 or Office 2019, the IFS function replaces a chain of nested IFs with one readable function [3].

## Before You Start

You need three things clear before you type anything.

First, the exact conditions and their order. Write them on paper as a ladder: the hardest test to pass at the top, the easiest at the bottom. A score of 92 passes "90 or above," "80 or above," and "70 or above," so the 90 test must come first or every high score lands in the wrong bucket.

Second, the return value for each condition. These can be text in quotes, numbers, cell references, or another calculation. In the grade example, each branch returns a single letter.

Third, a fallback for when nothing matches. The final IF in the chain still needs a `value_if_false`, and that value catches every case that failed all the tests. Leaving it out returns FALSE, which is rarely what you want.

The IF function itself is one of Excel's logical functions and returns one value when a condition is true and another when it is false [2]. Nesting simply chains that behavior. If you are new to the single-condition version, start with [How to Use the IF Function in Excel (Step by Step)](/blog/data-analysis/excel-if-function-step-by-step) and come back here.

## Step by Step

1. **Type the first test.** Start with the condition that only the top group can pass. For grades, that is `B2>=90`. The `>=` operator means "greater than or equal to," and you can read more about it in [Greater Than or Equal To in Excel](/blog/data-analysis/greater-than-or-equal-to-in-excel).

2. **Give the true result.** After the comma, type the value to return when the test passes, such as `"A"`. Text values need double quotes around them.

3. **Open a second IF in the false slot.** Instead of typing a fallback value, type `IF(` and start the next test. This is the nesting step. The second IF only runs when the first test fails.

4. **Repeat for each remaining condition.** Each new IF goes into the `value_if_false` position of the one before it, and each test gets looser than the last.

5. **Close the fallback.** The innermost IF gets a real `value_if_false`, such as `"F"`. This catches everything that failed every test.

6. **Count your parentheses.** Each IF opens one parenthesis, so a formula with four IF functions needs four closing parentheses at the end. Excel colors matching parentheses as you type, which helps you spot a missing one.

7. **Press ENTER and copy down.** After you complete the arguments, press ENTER to commit the formula [4]. Then drag the fill handle down the column so each row uses its own cell reference.

The finished formula for a four-tier grade scale looks like this:

```
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F")))
```

Microsoft's own grade example uses the same shape with five tiers, adding a `"D"` band for scores above 59 [4]. The pattern does not change with more tiers. You just add another IF in the false slot and one more closing parenthesis.

## Worked Example

The table below grades nine students. Column B holds each score, and column C holds the nested IF formula. The formula checks the score against 90, then 80, then 70, and returns A, B, C, or F.

| | A | B | C |
|---|---|---|---|
| **1** | Student | Score | Grade |
| **2** | Ana | 78 | `=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F")))` -> displays C |
| **3** | Ben | 92 | `=IF(B3>=90,"A",IF(B3>=80,"B",IF(B3>=70,"C","F")))` -> displays A |
| **4** | Cara | 65 | `=IF(B4>=90,"A",IF(B4>=80,"B",IF(B4>=70,"C","F")))` -> displays F |
| **5** | Dan | 81 | `=IF(B5>=90,"A",IF(B5>=80,"B",IF(B5>=70,"C","F")))` -> displays B |
| **6** | Eli | 70 | `=IF(B6>=90,"A",IF(B6>=80,"B",IF(B6>=70,"C","F")))` -> displays C |
| **7** | Fay | 55 | `=IF(B7>=90,"A",IF(B7>=80,"B",IF(B7>=70,"C","F")))` -> displays F |
| **8** | Gus | 88 | `=IF(B8>=90,"A",IF(B8>=80,"B",IF(B8>=70,"C","F")))` -> displays B |
| **9** | Hana | 73 | `=IF(B9>=90,"A",IF(B9>=80,"B",IF(B9>=70,"C","F")))` -> displays C |
| **10** | Ivan | 90 | `=IF(B10>=90,"A",IF(B10>=80,"B",IF(B10>=70,"C","F")))` -> displays A |
| **11** | Jo | 60 | `=IF(B11>=90,"A",IF(B11>=80,"B",IF(B11>=70,"C","F")))` -> displays F |

Trace two rows to see the logic in action.

For Ana, the score in B2 is 78. The first test, `B2>=90`, is false, so Excel moves to the nested IF. The second test, `B2>=80`, is also false. The third test, `B2>=70`, is true, so the formula returns C.

For Ivan, the score in B10 is 90. The first test, `B10>=90`, is true, so the formula returns A immediately and never evaluates the remaining tests. That early exit is why order matters. If the 70 test came first, Ivan's 90 would pass it and return C.

Eli's score of 70 also shows why you use `>=` instead of `>`. With `>=`, a score exactly on the boundary passes that tier. With `>`, Eli would fall through to F.

## Other Ways to Do It

**IFS function.** A single IFS function replaces the whole chain. The grade formula becomes:

```
=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")
```

IFS checks each condition in order and returns the value for the first TRUE one, and it can test up to 127 conditions [3]. The `TRUE` at the end acts as the fallback. IFS is available in Microsoft 365 and Office 2019 and later [3]. See [IFS Function in Excel: Syntax and Examples](/blog/data-analysis/ifs-function-excel) for the full syntax.

**AND and OR inside IF.** When one branch needs several conditions to hold at once, wrap them in AND. When any one of several conditions is enough, use OR. The structures are `IF(AND(logical1, logical2), value_if_true, value_if_false)` and `IF(OR(logical1, logical2), value_if_true, value_if_false)` [5]. A commission formula can combine both: `=IF(OR(C2>=125000,AND(B2="South",C2>=100000))=TRUE,C2*0.12,"No bonus")` pays 12 percent when the amount reaches 125,000, or when the region is South and the amount reaches 100,000 [6]. Read more in [IF AND Statements in Excel: Syntax and Examples](/blog/data-analysis/if-and-statements-excel) and [Excel IF OR: How to Combine IF and OR Functions](/blog/data-analysis/excel-if-or-combine-functions).

**A lookup table.** For many tiers, a reference table with VLOOKUP or INDEX MATCH is easier to maintain than a long formula. Microsoft notes that table values can be updated without touching the formula, and the table can live on another worksheet [1]. See [Excel INDEX MATCH with Multiple Criteria: Step by Step](/blog/data-analysis/excel-index-match-multiple-criteria).

## Troubleshooting

**The formula returns FALSE.** The innermost IF is missing its `value_if_false` argument. Add a fallback value so every path returns something.

**Excel rejects the formula.** You have a parenthesis mismatch or a missing comma. Count the opening and closing parentheses, and check that every IF has three arguments separated by commas.

**The formula returns #VALUE!.** One of the arguments refers to a cell containing an error value, and IF displays #VALUE! when that happens [7]. You can suppress it by wrapping the whole formula in IFERROR, as in `=IFERROR(IF(E2<31500,E2*15%,IF(E2<72500,E2*25%,E2*28%)),0)` [7].

**Every row returns the same grade.** The cell references are not relative. Check that the first formula uses `B2` and not `$B$2`, then copy it down.

**A boundary score lands in the wrong tier.** You used `>` where you needed `>=`, or the tests are in the wrong order. Put the strictest test first.

## Common Mistakes

- **Writing the tests in the wrong order.** Excel stops at the first TRUE result, so a loose test placed first swallows every value that would pass a stricter test [3]. Fix it by sorting the tests from hardest to easiest.
- **Forgetting the final fallback.** The last IF still needs a `value_if_false`. Without it, unmatched rows display FALSE instead of a real label.
- **Nesting too deeply.** Excel permits up to 64 nested IF functions, but Microsoft states it is not advisable to go that far because the formulas become hard to build, test, and update [1]. Switch to IFS or a lookup table once you pass a handful of tiers.
- **Mixing up commas and parentheses.** A missing comma merges two arguments, and a missing parenthesis breaks the whole formula. Build the formula one IF at a time and check the colored parenthesis matching as you go.
- **Using text without quotes.** `"A"` returns the letter A. A bare `A` makes Excel look for a named range and returns a #NAME? error.
- **Ignoring error values upstream.** If a referenced cell holds an error, the nested IF passes that error through to the result [7]. Wrap the formula in IFERROR when the source data can fail.

## Limitations

Nested IF formulas get hard to read fast. Each added tier adds another function and another closing parenthesis, and the logic reads inside out. Microsoft's own guidance is to keep IF statements to minimal conditions and to avoid nesting more than a few together [1]. When you find yourself counting parentheses to debug a formula, that is the signal to move to IFS or a lookup table.

Nested IF also cannot express every kind of logic cleanly. It handles ordered tiers well, but when conditions overlap or combine across columns, the formula grows into a wall of AND and OR calls that is difficult to audit. The IFS function is easier to read with multiple conditions, but it still requires the conditions to be entered in the correct order and can be difficult to build, test, and update when there are many of them [3]. For anything beyond a few tiers, a reference table with a lookup function is usually the more maintainable choice [1].

## Frequently Asked Questions

### How many IF statements can I nest in Excel?

Excel allows up to 64 nested IF functions in one formula [1]. That is a hard ceiling, not a recommendation. Microsoft advises against deep nesting because the formulas become difficult to build, test, and update [1]. In practice, most analysts switch to IFS or a lookup table well before reaching double digits.

### What is the difference between nested IF and IFS?

Nested IF chains separate IF functions inside each other's false arguments. IFS puts all the condition and result pairs in one function, separated by commas, and returns the value for the first TRUE condition [3]. IFS is easier to read, but it requires Microsoft 365 or Office 2019 and later [3]. Older versions of Excel only support nested IF.

### Can I use AND or OR inside a nested IF?

Yes. Replace the logical test with `AND(...)` when all conditions must hold, or `OR(...)` when any one is enough [5]. You can also combine them, as in `=IF(OR(C2>=125000,AND(B2="South",C2>=100000))=TRUE,C2*0.12,"No bonus")`, which pays commission when either the amount is high enough or the region and amount both qualify [6].

### Why does my nested IF return the wrong result?

The most common cause is test order. Excel returns the value for the first TRUE condition, so a broad test placed before a narrow one captures values that should have matched the narrow test [3]. Check the order first, then check whether you used `>` where the boundary requires `>=`.

### Should I use a lookup table instead of nested IF?

For a few tiers, nested IF is fine. For many tiers, or when the thresholds might change, a lookup table is easier to maintain because you update the table instead of editing the formula, and the table can sit on another worksheet [1]. If you are grading, banding, or mapping ranges to labels, a lookup table usually wins on readability.

## References

1. [IF function - nested formulas and avoiding pitfalls | Microsoft Support](https://support.microsoft.com/en-us/excel/if-function-nested-formulas-and-avoiding-pitfalls)
2. [IF function | Microsoft Support](https://support.microsoft.com/en-us/excel/functions/if-function)
3. [IFS function | Microsoft Support](https://support.microsoft.com/en-us/excel/functions/ifs-function)
4. [Use nested functions in an Excel formula | Microsoft Support](https://support.microsoft.com/en-us/excel/use-nested-functions-in-an-excel-formula)
5. [Using IF with AND, OR, and NOT functions in Excel | Microsoft Support](https://support.microsoft.com/en-us/excel/using-if-with-and-or-and-not-functions-in-excel)
6. [Use AND and OR to test a combination of conditions | Microsoft Support](https://support.microsoft.com/en-us/excel/use-and-and-or-to-test-a-combination-of-conditions)
7. [How to correct a #VALUE! error in the IF function | Microsoft Support](https://support.microsoft.com/en-us/excel/how-to-correct-a-value-error-in-the-if-function)

## Further Reading

- [Broman KW, Woo KH (2018). Data Organization in Spreadsheets. The American Statistician](https://doi.org/10.1080/00031305.2017.1375989)
- [Ziemann M, Eren Y, El-Osta A (2016). Gene name errors are widespread in the scientific literature. Genome Biology](https://doi.org/10.1186/s13059-016-1044-7)

## Related Articles

- [IF AND Statements in Excel: Syntax and Examples](/blog/data-analysis/if-and-statements-excel)
- [IFS Function in Excel: Syntax and Examples](/blog/data-analysis/ifs-function-excel)
- [Excel IF OR: How to Combine IF and OR Functions](/blog/data-analysis/excel-if-or-combine-functions)
- [How to Use the IF Function in Excel (Step by Step)](/blog/data-analysis/excel-if-function-step-by-step)
- [Google Sheets IF Function: Syntax and Examples](/blog/data-analysis/google-sheets-if-function)