We’re improving Formula Genius. We’re redesigning the app and fixing issues along the way. Sorry for any disruption, and thank you for your patience.
Excel beginner

Nested IF Statements in Excel (And Better Alternatives)

Nested IFs get messy fast. Here's how to write them cleanly — and when to use IFS or SWITCH instead.

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 letter grades based on score: A (90+), B (80-89), C (70-79), D (60-69), F (below 60)"

Excel
=IFS(A2>=90,"A",A2>=80,"B",A2>=70,"C",A2>=60,"D",TRUE,"F")

IFS evaluates conditions in order and returns the value for the first TRUE condition. The final TRUE acts as an else/default case. This is cleaner than nested IF statements.

Step-by-step breakdown

  1. IFS checks each condition left to right, stopping at the first TRUE
  2. A2>=90,"A" — scores 90+ get an A
  3. A2>=80,"B" — remaining scores 80+ get a B (90+ already caught)
  4. Order matters: conditions are evaluated top to bottom
  5. TRUE,"F" — the catch-all default for anything not matched above

Edge cases & warnings

  • IFS requires Excel 2019+ or Excel 365 — use nested IF for older versions
  • If no condition is TRUE and no default is provided, returns #N/A
  • Conditions must be mutually exclusive OR ordered from most restrictive to least
  • Text comparisons in conditions are case-insensitive

Examples

Prompt

"Score = 95"

Excel
"A"
Prompt

"Score = 73"

Excel
"C"
Prompt

"Score = 45"

Excel
"F"

Frequently asked questions

How many IFs can I nest?

Excel allows up to 64 nested IFs, but if you need more than 3-4, use IFS, SWITCH, or a lookup table instead. Deeply nested IFs are hard to debug.

What's the difference between IFS and nested IF?

They produce the same result. IFS is cleaner syntax: =IFS(cond1,val1,cond2,val2) vs =IF(cond1,val1,IF(cond2,val2,...)). Use IFS when available.

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.