🧮

Excel IF Statements and Nested IFs

Sep 8, 2025

Overview

This lecture explains the structure and use of IF statements and nested IFs in Microsoft Excel, especially for handling multiple conditions and displaying different outputs based on cell values.

IF Statements in Excel

  • An IF statement compares a condition and returns a value if true, another if false.
  • The syntax is: IF(condition, value_if_true, value_if_false).
  • The condition must be a logical test (e.g., A1 > 10, B2 = "Yes").
  • value_if_true is the result or text shown if the condition is true.
  • value_if_false is the result or text if the condition is false.

Using Nested IFs for Multiple Outcomes

  • An IF statement only handles two outcomes (true or false).
  • For more than two possibilities, use nested IFs (put another IF inside the false section).
  • Example with codes: P for Part Time, E for Employee, and A for Admin.
    • First IF checks if code is "P" (Part Time).
    • In the false part, a second IF checks if code is "E" (Employee).
    • If neither, the default is Admin.

Nested IF Example with Numbers

  • For sales categories: ≤250 is Bronze, 251–600 is Silver, >600 is Gold.
  • Start by checking the top or bottom value, not the middle.
    • First IF: If sales ≤250, return "Bronze".
    • Else, nested IF: If sales >600, return "Gold".
    • Else, return "Silver" (covers the middle range by default).
  • Always close each IF with a bracket.

Tips for Writing Nested IFs

  • Ignore the middle condition with numbers; leave it for the final else/default.
  • Each extra outcome requires another nested IF.
  • Carefully match parentheses for each IF.

Key Terms & Definitions

  • IF Statement — A function in Excel for conditional logic that returns values based on true/false tests.
  • Nested IF — An IF statement within another IF statement to handle more than two outcomes.
  • Logical Test/Condition — A statement that is either TRUE or FALSE (e.g., B2 = "Yes", A1 > 100).

Action Items / Next Steps

  • Practice creating IF and nested IF statements for both text-based and number-based scenarios.
  • Review Excel function syntax and parenthesis matching.
  • Prepare questions or examples for the next class.