Back to Blog

How to Write Nested IF Statements in Excel

D
David DeSouza
Dec 1, 2025
6 min read
Illustration for How to Write Nested IF Statements in Excel

The Problem

You need to grade scores: >90 is A, >80 is B, otherwise C. A single IF can't handle this three-way logic.

The Easy Way: Use SheetXAI

If you don't want to mess with formulas, the fastest way to do this is simply by asking.

With SheetXAI, you can open the sidebar and type:

If score is > 90 put A, if > 80 put B, else C.

SheetXAI will instantly write the formula or script for you and fill the cells. It handles the syntax so you can focus on the result.

The Manual Way: The Formulas You Need

To do this manually, you need to use: IF (multiple times).

1. IF

Checks a condition and returns one value if true, another if false.

Syntax: =IF(logical_test, value_if_true, value_if_false)

  • logical_test: The value or expression that can be evaluated to TRUE or FALSE.
  • value_if_true: The value that you want to be returned if the logical_test argument evaluates to TRUE.
  • value_if_false: The value that you want to be returned if the logical_test argument evaluates to FALSE.

Example: =IF(A1>50, "Pass", "Fail")

Understanding the Logic

We check the first condition. If it fails, instead of just saying "False", we start a new IF formula in the "False" slot.

The Final Formula:

=IF(A2>90, "A", IF(A2>80, "B", "C"))

Conclusion

Now you know the "classic" way to solve this using formulas. It's a great skill to have.

But for those times when you just want the job done without the mental math, SheetXAI is there to help.

Boost your productivity today.
Start automating your spreadsheets.

Join thousands of professionals saving hours every week. No credit card required to start.

Learn more