ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. Nested IF in Excel: Grades, Bands and Tiers

Nested IF in Excel: Grades, Bands and Tiers

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

A nested IF puts a second IF in the value_if_false slot of the first, so one formula can return three or more results. For grades: =IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F"))). Excel checks the tests in order and stops at the first TRUE one, so test the highest band first.

Key takeaways

  • Each extra IF goes in the value_if_false slot of the IF before it.
  • Excel stops at the first TRUE test, so order the tests from the highest band down (or the lowest band up with <).
  • You need one closing bracket for every IF, all at the end of the formula.
  • In Excel 2019 and Microsoft 365, IFS does the same job without nesting.
  • For more than four or five bands, a lookup table is easier to read and update.
On this page+
  1. What is a nested IF in Excel?
  2. How to write a nested IF Excel formula for grades
  3. Why does the order of the tests matter?
  4. Nested IF example: commission tiers
  5. Can a nested IF test text instead of numbers?
  6. What are the most common nested IF mistakes?
  7. When should you use IFS or a lookup table instead?
  8. Practise it

A nested IF Excel formula is an IF with another IF inside it. One IF can only choose between two results; nesting lets a single formula pick from three, four or more, such as letter grades, commission tiers or delivery bands. This guide shows the pattern, the one rule that makes it work, and when to switch to IFS or a lookup table instead.

What is a nested IF in Excel?#

A nested IF puts a second IF in the value_if_false slot of the first. A function inside another function is called "nested". The shape for three results is:

Excel formula
=IF(test1, result1, IF(test2, result2, result3))

Excel reads it like a sentence: if test1 is TRUE, show result1. Otherwise, if test2 is TRUE, show result2. Otherwise, show result3. Each extra IF adds one more possible result. If plain IF is still new, read the Excel IF function explained simply first.

How to write a nested IF Excel formula for grades#

Build it one band at a time, from the top grade down. The grade rules here are: 90 or more is A, 80 or more is B, 70 or more is C, and anything lower is F.

Excel formula
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F")))
StudentScoreGradeWhy
Ana94A94 passes the first test
Ben81BFails >=90, passes >=80
Dev78CFails the first two, passes >=70
Eli90AExactly 90, and >= includes it
Fay55FFails every test, so the last result shows

Notice what each part does:

  • B2>=90,"A" is the first test and its result.
  • The second IF sits where the first IF's FALSE result would go. Only scores below 90 reach it.
  • "F" is the final FALSE result. It catches everything that failed all three tests.
  • ))) closes the three IFs. Count your IFs and add the same number of closing brackets.

Why does the order of the tests matter?#

Excel checks the tests from left to right and stops at the first TRUE one. Put the tests in the wrong order and higher scores fall into a lower band:

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

With this formula, Ana's 94 gets a C. 94 is at least 70, so the first test is TRUE and Excel never looks at the A test. There's no error message, just a wrong answer, which is why this mistake survives into real reports.

There are two safe orders:

  1. Highest band first, with >=, as in the grade formula above.
  2. Lowest band first, with <: =IF(B2<70,"F",IF(B2<80,"C",IF(B2<90,"B","A"))). This gives the same grades.

Pick one direction and stick to it. Mixing > and < in one formula is where gaps appear.

Nested IF example: commission tiers#

Bands work the same way with numbers. A sales team earns 8% on sales of 100000 or more, 5% on 60000 or more, 3% on 30000 or more, and nothing below that:

Excel formula
=IF(B2>=100000,0.08,IF(B2>=60000,0.05,IF(B2>=30000,0.03,0)))
RepSalesRateCommission =B2*C2
Jordan1240008%9920
Kim580003%1740
Luis610005%3050
Maya295000%0
Noah1000008%8000

Noah sold exactly 100000. Because the test uses >=, he gets the top rate. With > he would drop to 5%. Rates are numbers, so they don't need quotes. Type 0.08 or 8%, and type 100000 without a comma: inside a formula, a comma separates arguments.

Can a nested IF test text instead of numbers?#

Yes. Each test can compare text, as long as the text is in double quotes. Here, status codes become labels:

Excel formula
=IF(D2="P","Pending",IF(D2="S","Shipped",IF(D2="D","Delivered","Check code")))

For exact matches like this, the order of the tests doesn't matter, because only one code can match. The last result, "Check code", catches anything unexpected, such as a new code or a typo. Text tests ignore capital letters, so "p" matches too, but a hidden space after the code doesn't.

When you are matching one cell against a list of exact values, the SWITCH function is shorter: =SWITCH(D2,"P","Pending","S","Shipped","D","Delivered","Check code"). It needs Excel 2019 or later.

What are the most common nested IF mistakes?#

Most broken nested IFs have one of these problems:

MistakeWhat happensFix
Tests in the wrong orderHigh values get a low bandHighest band first with >=
Missing last result: IF(B2>=70,"C")Low scores show FALSEAdd the final FALSE result, like "F"
Too few closing bracketsExcel won't accept the formulaOne ) per IF
> where the rule says "or more"Values on the boundary drop a bandUse >=
Thousands typed with commas, like 100,000Wrong results or an errorType 100000

Excel colours each pair of brackets differently while you edit, which helps you count them. You can also press Alt+Enter (Windows) or Option+Return (Mac) inside the formula bar to put each IF on its own line. Excel ignores the line breaks.

If a band formula returns an error because the input cell holds an error, wrap the input check with IFERROR, used the right way, rather than hiding errors from your own formula.

When should you use IFS or a lookup table instead?#

Use a nested IF for two to four bands in a file that must work in any Excel version. Beyond that, other tools are easier to read:

  • IFS lists test and result pairs with no nesting: =IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F"). It needs Excel 2019, Excel 2021 or Microsoft 365. Learn it in the Excel IFS function guide, or see the full nested IF vs IFS comparison.
  • A lookup table keeps the bands in cells. List the lower limits (0, 70, 80, 90) in F2:F5 and the grades in G2:G5, then use =VLOOKUP(B2,$F$2:$G$5,2,TRUE). The limits must be sorted from smallest to largest. When the bands change, you edit cells, not formulas. See how VLOOKUP's approximate match finds bands.
  • Several conditions in one band, like "sales over 50000 and a rating of at least 4.5", need AND or OR inside the test. See AND, OR and NOT with IF.

The IF function guide and the IFS function guide list every argument if you need a quick reference.

Practise it#

Nested IFs feel tricky until you have built a few. Try the commission exercise on this page, then practise nested IF and IFS in a live spreadsheet. The lesson has you fix a formula with its tests in the wrong order, rewrite it with IFS, and calculate commission in one formula.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The commission rate is 0.08 for sales of 100000 or more, 0.05 for 60000 or more, 0.03 for 30000 or more, and 0 below that. In C2, write a nested IF that returns the rate for the sales in B2. Test the highest band first. Type numbers without commas.

fx
ABCD
1
Rep
Sales
Rate
2
Jordan
124000
3
Kim
58000
4
Luis
61000
5
Maya
29500
6
Noah
100000
7
Olga
87000
8
9
10

Tip: Start with =IF(B2>=100000,0.08, and put the next IF where the FALSE result would go. You need three IFs and three closing brackets.

Practise this in a lesson

LessonNested IF and IFSHandle more than two outcomes, like letter grades or commission bands, with nested IFs or the cleaner IFS.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.Function guideIFSReplace messy nested IFs with Excel's IFS function. Examples for grades, tiers and SLAs, the catch-all trick, and a live exercise.

Frequently asked questions

How do I do a nested IF with 3 conditions in Excel?

+

Put a second IF where the FALSE result of the first one goes: =IF(B2>=90,"A",IF(B2>=80,"B","Below B")). Each IF adds one more outcome.

Why does my nested IF give the wrong grade?

+

The tests are probably in the wrong order. Excel stops at the first TRUE test, so if B2>=70 comes before B2>=90, a score of 94 gets the 70 band. Test the highest band first.

How many IF functions can you nest in Excel?

+

Excel 2007 and later allow up to 64 nested functions in one formula. Long before that limit, a lookup table or IFS is easier to read and maintain.

Is IFS better than nested IF?

+

IFS is easier to read because it has no nesting, but it needs Excel 2019 or later. Nested IF works in every version, so it is the safe choice for shared files.

Sources

  • IF function - Microsoft Support
  • IFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What is a nested IF in Excel?
  2. How to write a nested IF Excel formula for grades
  3. Why does the order of the tests matter?
  4. Nested IF example: commission tiers
  5. Can a nested IF test text instead of numbers?
  6. What are the most common nested IF mistakes?
  7. When should you use IFS or a lookup table instead?
  8. Practise it

Keep reading

Logic· 6 min read

The Excel IFS Function: Cleaner Than Nested IFs

The Excel IFS function checks a list of conditions in order and returns the result paired with the first TRUE one: =IFS(test1, value1, test2, value2, ...). It replaces nested IFs without the brackets. IFS has no "otherwise" result, so end with TRUE and a fallback value. It needs Excel 2019 or later.

Logic· 7 min read

AND, OR and NOT in Excel With IF

AND returns TRUE only when every condition is TRUE. OR returns TRUE when at least one condition is TRUE. NOT flips TRUE to FALSE and FALSE to TRUE. On their own they give TRUE or FALSE, so you usually put them inside IF's test, like =IF(AND(C2>=50000,D2>=4.5),"Bonus","No bonus").

Logic· 6 min read

IFERROR in Excel: Hide Errors the Right Way

IFERROR returns a formula's normal result, or a value you choose if the formula gives an error: =IFERROR(value, value_if_error). For example, =IFERROR(B2/C2,0) shows 0 instead of #DIV/0!. It catches every error type, including mistakes in your own formula, so check the formula works first, and use IFNA for lookups.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free