Nested IFs
Part of the Fundamentals section of Coddy's Excel journey — lesson 37 of 42.
One IF picks between two answers. But what about grades, A, B or C? The trick is to put a second IF inside the first, in the false-answer slot. This is called a nested IF:
=IF(A1>=90, "A", IF(A1>=80, "B", "C"))Read it from left to right: is A1 at least 90? Yes → show A, done. No → don't give up, ask the next question: is it at least 80? Yes → B, no → C. Each IF handles one question and hands the rest to the next.
The order of the checks matters. Excel stops at the first condition that's true, so you test the highest band first. If you asked A1>=80 first, a 95 would grab the B before the A check ever ran.
Two bookkeeping tips: every IF you open needs its own closing parenthesis, two IFs, two ) at the end. And each extra IF adds exactly one more possible answer: two nested IFs give three outcomes, three IFs give four, and so on.
Challenge
EasyThe sheet holds a test score: Score in A1 and the number in B1.
In C1, write a nested IF that turns the score into a letter grade:
Afor scores of 90 or moreBfor scores of 80 or more (but under 90)Cfor everything else
Use capital letters A, B, C. The tests will send a score into each band, check your bands from the top down.
Try it yourself
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Score | 87 | |||||
| 2 | |||||||
| 3 | |||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 | |||||||
| 8 | |||||||
| 9 | |||||||
| 10 | |||||||
| 11 | |||||||
| 12 | |||||||
| 13 | |||||||
| 14 |
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet the Spreadsheet
What Is a Spreadsheet?Cells and ReferencesYour First CellsRows, Columns and the GridRecap: Meet the Grid4Cell References
Referencing Other CellsFormulas That UpdateChained FormulasRanges from A1 to A10Recap: Cell References7Decisions with IF
The IF FunctionWriting an IFComparison OperatorsNested IFsRecap: Decisions with IF