Excel intermediate

How to Use Nested IF Statements for Grading

Assigning grades based on scores can be complex, but nested IF statements simplify this process in Excel.

Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.

The formula

Prompt

"Assign a grade label (A, B, C, D, F) based on a score in a cell using nested IF logic"

Excel
=IF(A1>=90, "A", IF(A1>=80, "B", IF(A1>=70, "C", IF(A1>=60, "D", "F"))))

This formula assigns a grade label based on the score in cell A1 using nested IF statements.

Step-by-step breakdown

  1. Check if the score is 90 or above; if true, return 'A'.
  2. If not, check if the score is 80 or above; if true, return 'B'.
  3. If not, check if the score is 70 or above; if true, return 'C'.
  4. If not, check if the score is 60 or above; if true, return 'D'.
  5. If none of the conditions are met, return 'F'.

Edge cases & warnings

  • Scores below 0 should return 'F' but may cause confusion.
  • Scores exactly on the boundary (e.g., 90, 80) must be handled correctly.
  • Non-numeric inputs should return an error or a specific message.

Examples

Prompt

"Score of 85"

Excel
B
Prompt

"Score of 72"

Excel
C

Frequently asked questions

Can I use this formula for different grading scales?

Yes, you can adjust the score thresholds to fit your grading scale.

What happens if the score is a text value?

The formula will return an error if the input is not numeric.

Is there a limit to how many nested IF statements I can use?

Excel allows up to 64 nested IF statements in a single formula.

Can't find what you need?

Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.