Convert a score into a letter grade (nested IF)
The problem
Problem statement
It's report-card season: exam scores are already entered, and the school system needs a letter grade beside each one. Fill the Letter cell B2 with a grade for the score in A2: A for scores ≥90, B for ≥80, C for ≥70, otherwise D.
Test the highest threshold first — case 2 scores 94 and must not fall through to B.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | |
|---|---|---|
| 1 | Score | Letter |
| 2 | 87 |
Notes
Evaluate thresholds from high to low. Modern Excel also offers IFS, but nested IF remains the interview classic.
How to approach
Your answer goes in B2. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.
- Start with
IF(A2>=90,"A", ...) - Nest the next
IFfor the 80 threshold - The final false branch should return "D"
Official solutions
Show 1 solution — try it yourself first
Approach 1: Top-down nested IF logic
=IF(A2>=90,"A",IF(A2>=80,"B",IF(A2>=70,"C","D")))
Evaluates from highest grade to lowest: checks ≥90 for A, then ≥80 for B, then ≥70 for C, defaulting to D for anything below 70.
Function guide
FAQ
How do I build a nested IF letter grade formula?
Evaluate high to low, for example =IF(A2>=90,"A",IF(A2>=80,"B",IF(A2>=70,"C","D"))).
Can I use IFS instead of nested IF?
Yes in modern Excel and Google Sheets. Nested IF is still useful for interviews and older workbooks.