IF

Beginner

Logical

Returns one value if a condition is TRUE and another value if it's FALSE. Essential for conditional logic in Excel.

Syntax
=IF(logical_test, value_if_true, value_if_false)
Parameters
logical_test
Required
(logical)

Condition to test (e.g., A1>10)

value_if_true
Required
(any)

Value returned if condition is TRUE

value_if_false(any)

Value returned if condition is FALSE

Examples
Real-world examples to help you understand how to use IF

Basic pass/fail check

=IF(A1>=60, "Pass", "Fail")

Returns "Pass" if A1 is 60 or greater, otherwise "Fail"

Result: Pass or Fail

Nested IF for grading

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

Assigns letter grades based on score ranges

Result: A, B, C, or F

Calculate bonus

=IF(B1>10000, B1*0.1, 0)

Give 10% bonus if sales exceed 10,000

Result: 10% of B1 or 0

Common Use Cases
  • Grade students based on scores
  • Calculate bonuses or commissions
  • Flag errors or outliers in data
  • Create conditional formatting alternatives
  • Build decision trees
Pro Tips
  • 💡Nest up to 64 IF functions in Excel 2019+
  • 💡Use IFS() for cleaner multiple conditions
  • 💡Combine with AND/OR for complex logic
  • 💡Remember to close all parentheses
Common Errors
  • ⚠️#VALUE! - Incorrect data types in comparison
  • ⚠️Missing value_if_false returns FALSE by default
  • ⚠️Too many nested IFs reduce readability
Related Formulas

Need a Custom IF Formula?

Our AI can generate tailored formulas based on your specific needs

Generate Custom Formula