Logical
8.1K monthly searches
Beginner
4 min read

IF Formula in Excel - Conditional Logic & Decision Making

Make decisions in your spreadsheets with the IF function in Excel....

Quick Start

Syntax

=IF(logical_test, value_if_true, [value_if_false])

Parameters

logical_test - Required. Condition to test (e.g., A1>100, B2="Yes"). Returns TRUE or FALSE.

value_if_true - Required. Value to return when condition is TRUE (text, number, or formula).

value_if_false - Optional. Optional. Value to return when FALSE. Defaults to FALSE if omitted.

Simplest Example

AB
1ScoreGrade
295
375
4Formula:
=IF(A2>=90,"A","B")
A

Quick Reference

Basic IF Formula
=IF(A1>100, "High", "Low")

Example: A1=150

=IF(150>100) → "High"

IF with Calculations
=IF(A1>=90, A1*0.1, 0)

Example: A1=95

=IF(95>=90, 9.5, 0) → 9.5

Nested IF (Multiple Conditions)
=IF(A1>=90,"A",IF(A1>=80,"B","C"))

Example: A1=85

=IF(85>=90,IF(85>=80)) → "B"

IF with AND (Multiple Tests)
=IF(AND(A1>=18,B1="US"),"Eligible","Not")

Example: A1=21, B1="US"

=IF(AND(TRUE,TRUE)) → "Eligible"

Real-World Examples

Assign Letter Grades from Test Scores

Nested IF formulas to convert numeric scores (0-100) into letter grades (A, B, C, D, F). Each IF tests a range. The IF function in Excel is perfect for grading systems in education, employee performance reviews, quality control scoring, and automated assessment workflows. This Excel IF formula structure handles multiple grade tiers efficiently without complex logic, making it ideal for teachers, HR managers, and data analysts who need reliable grading automation.

ABC
1StudentScoreGrade
2Alice95
3Bob78
4Formula:
=IF(A2>=90,"A",IF(A2>=80,"B","C"))
A
Pro Tip: Use IFS function (Excel 365+) for cleaner multi-tier grading without deep nesting.
Tiered Commission Calculation

Calculate sales commission rates based on performance tiers. Higher sales earn higher commission percentages. The Excel IF function enables dynamic compensation models where commission rates automatically adjust based on achievement levels. This IF formula pattern is essential for sales teams, account managers, and finance departments managing variable compensation structures. Nested IF statements create fair, transparent commission tiers that motivate performance while maintaining budget control.

ABC
1SalespersonSalesCommission Rate
2Alice$125,000
3Formula:
=IF(B2>=100000,15%,IF(B2>=50000,10%,5%))
15%
Pattern: Nested IF: 15% if ≥$100K, 10% if ≥$50K, else 5%
Need more? Advanced techniques and complex scenarios? View advanced techniques →

Common Mistakes to Avoid

=IF(A1>100, "High")Missing value_if_false argument

❌ The Problem:

  • Returns FALSE when condition is false, not empty
  • May cause unexpected results in further calculations
  • Less readable for others reviewing the formula

✅ Solution:

=IF(A1>100, "High", "Low")

Always specify both value_if_true and value_if_false for clarity.

=IF(A1>100, TRUE, FALSE)Unnecessary IF for TRUE/FALSE

❌ The Problem:

  • The comparison A1>100 already returns TRUE or FALSE
  • Adds unnecessary complexity
  • Harder to read and maintain

✅ Solution:

=A1>100

Use the comparison directly - it already returns a boolean value.

=IF(A1=100, "Equal")Confusing = comparison with assignment

❌ The Problem:

  • Missing value_if_false - returns FALSE when not equal
  • May confuse readers expecting assignment operator
  • Not clear what happens when A1 ≠ 100

✅ Solution:

=IF(A1=100, "Equal", "Not Equal")

Always provide both outcomes explicitly for clear logic.

Frequently Asked Questions

Other Logical Functions

Want to Learn More?

Advanced Techniques

Power user tips and complex scenarios

Error Troubleshooting

Fix common errors and issues

How-to Guides

Step-by-step tutorials

Related Formulas

Master these IF Function variants:

Master Excel IF Function

From basics to advanced - AI generates perfect formulas instantly.