# How to assign letter grades with IF or IFS in Excel

Use IFS with the conditions from the highest grade down: =IFS(score>=90,"A",score>=80,"B",score>=70,"C",score>=60,"D",TRUE,"F").

**Excel:** `=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"D",TRUE,"F")` (Excel 2019 and later, including Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C |
| --- | --- | --- |
| Student | Score | Grade |
| Ava | 93 |  |
| Ben | 78 |  |
| Chloe | 85 |  |
| Dan | 61 |  |
| Eve | 54 |  |
| Finn | 70 |  |
| Gia | 89.5 |  |

Formula in C2, filled to C8: `=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"D",TRUE,"F")`

Result: A; C; B; D; F; C; B

## How it works

IFS checks the conditions in order and returns the result for the first one that is TRUE, so the order matters: checking `>=60` first would give every passing score a D. The last pair, `TRUE,"F"`, is the catch-all for everything below 60.

## Other ways

- `=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C",IF(B2>=60,"D","F"))))`: Nested IFs give the same result and work in every version.
- `=XLOOKUP(B2,{0,60,70,80,90},{"F","D","C","B","A"},,-1)`: A lookup on the band starts is easier to change. In a real sheet, keep the bands in cells.

## Common mistakes

- Without the final `TRUE,"F"`, IFS returns #N/A for scores that match no condition.
- 89.5 gets a B here. If grades should round first, use `ROUND(B2,0)` in each test.

## Questions

**Is IFS available everywhere?**

IFS is in Excel 2019 and later, Microsoft 365 and Google Sheets. Use nested IFs for Excel 2016 and older.

**Can I use SWITCH for grades?**

SWITCH matches exact values, so it suits categories like "1→Low". For ranges of scores, use IFS or a lookup.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-29.

Source: https://spreadsheetpractice.com/formulas/nested-if-grades
