Nested IF for grades, explained
Free, no login, no limit. Runs in your browser. Paste an Excel or Google Sheets formula and get it in plain English, step by step. Nothing you paste is sent anywhere.
In plain English
Checks whether B2 is greater than or equal to 90. If it is, the result is "A"; if not, it's the result of IF (step 2).
Works in: all current Excel versions, Google Sheets
Where each function is taught
Explain this Excel formula, step by step
Inside out: the order the spreadsheet works it out.
- 1IF
=IF(B2>=70, "C", "F")= FChecks whether
B2is greater than or equal to70. If it is, the result is"C"; if not, it's"F".condition B2>=70a comparison that's TRUE or FALSE value_if_true "C"what to show when it's TRUE value_if_false "F"what to show when it's FALSE. Leave it out and a failed test shows FALSE From the course:
Guide: IF with AND and OR Lesson 10IFturns a comparison into a choice: one result when it's TRUE, another when it's FALSE. - 2IF
=IF(B2>=80, "B", IF(B2>=70, "C", "F"))= FChecks whether
B2is greater than or equal to80. If it is, the result is"B"; if not, it's the result of step 1.condition B2>=80a comparison that's TRUE or FALSE value_if_true "B"what to show when it's TRUE value_if_false the result of step 1 what to show when it's FALSE. Leave it out and a failed test shows FALSE From the course:
Guide: IF with AND and OR Lesson 10IFturns a comparison into a choice: one result when it's TRUE, another when it's FALSE. - 3IF
=IF(B2>=90, "A", IF(B2>=80, "B", IF(B2>=70, "C", "F")))= FChecks whether
B2is greater than or equal to90. If it is, the result is"A"; if not, it's the result of step 2.condition B2>=90a comparison that's TRUE or FALSE value_if_true "A"what to show when it's TRUE value_if_false the result of step 2 what to show when it's FALSE. Leave it out and a failed test shows FALSE From the course:
Guide: IF with AND and OR Lesson 10IFturns a comparison into a choice: one result when it's TRUE, another when it's FALSE.
Try it on a sample sheet
We filled the cells your formula reads with sample numbers and put the formula in D2. Type your own values (text works too) and watch the result and the steps above update.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | ||||
| 2 | 64 | F | ||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 |
What this formula does
Each IF tests one boundary. If the score in B2 is at least 90 the answer is A; if not, the next IF tests 80, then 70, and anything below that is F. The tests run from the highest bar down, so a score of 85 fails the first test and stops at B.
When to use it
Use it for a small number of bands: grades, rating labels, size categories. Beyond three or four levels, IFS reads more easily, and a lookup table with approximate XLOOKUP or VLOOKUP is easier to change when the boundaries move.
Common mistakes
- Testing the lowest bar first, so every score above 70 gets C.
- Forgetting the final fallback, so a low score shows FALSE.
Variations
- =IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")The same with IFS; the final TRUE catches everything else.
- =XLOOKUP(B2,$G$2:$G$5,$H$2:$H$5,,-1)Boundaries in a table, found with match mode -1.
Read next
Practise this in 5 minutes
Everything this formula uses is taught in Lesson 10: TRUE, FALSE and IF (Unit 3, Decisions), on a live sheet with instant feedback. Pro
Open “TRUE, FALSE and IF”Need a quick reference? The formula cheat sheet is free to read and print.
How the formula explainer works
It reads your formula with the same engine that grades formulastreak's lessons, then describes each function in the order a spreadsheet calculates it: the innermost first. Every argument gets a name and a plain-English meaning, taken from the lesson that teaches that function.
Then it builds a small sample sheet around the cells your formula reads, so you can see what each step returns and change the numbers to test it. Nothing is uploaded: it all happens in this page.
Google Sheets formulas too
Most formulas are written the same way in Excel and Google Sheets, so the explainer reads both. Under each explanation it says which Excel versions and whether Google Sheets have every function the formula uses, from Microsoft's and Google's own function lists. Where the two differ, such as SORT's direction argument or functions Google Sheets doesn't have, the note says so.
Want to understand the errors instead? Try the Excel error decoder, or read the formula guides.
Popular formulas, explained
- IFERROR with VLOOKUP, explained
=IFERROR(VLOOKUP(F2,$A$2:$C$9,3,FALSE),"Not found") - INDEX MATCH, explained
=INDEX($C$2:$C$9,MATCH(F2,$A$2:$A$9,0)) - INDEX MATCH MATCH (two-way lookup), explained
=INDEX(C2:E9,MATCH(I1,A2:A9,0),MATCH(I2,C1:E1,0)) - SUMIFS between two dates, explained
=SUMIFS(D2:D20,A2:A20,">="&H1,A2:A20,"<="&H2) - IF with AND, explained
=IF(AND(B2>=100,C2="Yes"),"Bonus","No bonus") - XLOOKUP with a not-found message, explained
=XLOOKUP(G2,A2:A9,C2:C9,"Missing") - COUNTIF to flag duplicates, explained
=COUNTIF($A$2:$A$11,A2)>1 - Count unique values with SUMPRODUCT and COUNTIF, explained
=SUMPRODUCT(1/COUNTIF(A2:A11,A2:A11)) - Nested IF for grades, explained
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F"))) - SORT with FILTER, explained
=SORT(FILTER(A2:C20,C2:C20>1000),3,-1)
Questions
Which formulas can it explain?+
Any formula written for Excel or Google Sheets: it reads cell references, ranges, operators, text, nested functions, LET and LAMBDA. It describes about 150 functions in detail. If it meets a function it doesn't know yet, it says so and still explains the rest.
Does my formula leave my computer?+
No. The explanation and the sample sheet run entirely in your browser. Nothing you paste is sent to our server.
Why does it explain the formula inside-out?+
That's the order a spreadsheet works it out: the innermost functions first, then the functions that use their results. Reading it in that order makes long formulas much easier to follow.
Does it work for formulas from another sheet or workbook?+
Yes. References like Prices!A2:C9 are explained without the sheet name. Excel table references like Table1[Amount] aren't supported yet.
Is it the same in Excel and Google Sheets?+
Most formulas are. Below each explanation you'll see which versions of Excel and whether Google Sheets support every function it uses.