Nested IF in Excel - Tutorial

Nested IF in Excel

📘 What is Nested IF?

Nested IF allows multiple conditional checks in Excel. It is useful for grading, categorization, and logical decision-making.

Excel Logo for SEO

Example Formula

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

This formula assigns grades based on score ranges.

💻 Interactive Demo

Enter a score to see the grade:

📝 More Examples

Nested IF can handle multiple scenarios. Here is another common use case:

Price Category

=IF(B2<50,"Cheap",IF(B2<100,"Moderate","Expensive"))

⚠️ When to Avoid Nested IF

While powerful, deeply nested IF formulas are hard to read and maintain. Consider using the IFS function (Excel 2016 and later) or lookup functions (VLOOKUP, INDEX/MATCH) for clearer logic.

🔗 Related Functions & Alternatives

  • IFS – evaluates multiple conditions without nesting.
  • SWITCH – matches an expression against a list of values.
  • VLOOKUP, INDEX/MATCH – lookup tables for multi‑criteria logic.

🛠 Tips for Writing Nested IFs

  • Start with the most restrictive condition first.
  • Use line breaks and indenting (Alt+Enter) in the Excel formula bar for readability.
  • Label ranges or cells with names to make formulas self‑documenting.

No comments:

Post a Comment