What You'll Learn

  • How to nest one IF function inside another
  • Why condition order matters in a nested IF
  • What IFS is, as a cleaner alternative to deeply nested IFs

A single IF only handles two outcomes. When you need to sort something into three or more categories, you can nest one IF inside another:

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

Read this from the inside out won't work — read it top to bottom instead: Excel checks the first condition first; if it's false, it moves to the next IF, and so on, only reaching "F" if none of the earlier conditions matched.

Order Matters

Conditions must go from most restrictive to least restrictive (checking >=90 before >=80). If you checked >=70 first, every score of 90 or above would also satisfy >=70 and get stopped there incorrectly, never reaching the correct "A" result.

A Cleaner Alternative: IFS

In newer Excel versions, the IFS function can replace deeply nested IFs with a flatter, easier-to-read structure: =IFS(A1>=90,"A",A1>=80,"B",A1>=70,"C",TRUE,"F").

Common Mistakes

  • Ordering conditions from least restrictive to most restrictive, causing higher values to get caught by an earlier, looser condition
  • Losing track of parentheses in a deeply nested formula

Practice Exercise

Build a column of 10 test scores. Use a nested IF to assign a letter grade: A (90+), B (80+), C (70+), F (below 70).

Ready to Test What You Learned?

Take a short quiz to check your understanding.

Take a Quiz

Key Takeaways

  • Nested IFs let you sort values into more than two categories
  • Order conditions from most restrictive to least restrictive
  • IFS (where available) can replace deeply nested IFs with a flatter structure