Excel IF Function

IF tests a condition and returns one result when the condition is TRUE and another when it is FALSE.

Use it to turn spreadsheet logic into decisions, such as pass or fail, eligible or ineligible, late or on time, or which calculation should run next.

1
Ask a question Build a TRUE/FALSE test
2
Choose the TRUE result Returned when the test passes
3
Choose the FALSE result Returned when the test fails

IF syntax & arguments

Syntax

=IF(logical_test, value_if_true, [value_if_false])
Required Optional
  1. 1

    logical_test

    Required

    The test Excel evaluates as TRUE or FALSE, such as A2>=70.

  2. 2

    value_if_true

    Required

    The result to return when logical_test is TRUE.

  3. 3

    value_if_false

    Optional

    The result to return when logical_test is FALSE. If omitted, Excel returns FALSE for a failed test.

Example

=IF(C2>=70, "Pass", "Review")

Return Pass when C2 is at least 70, otherwise return Review.

IF caveats

IF is the foundation of many Excel formulas, but small logic mistakes can make formulas hard to trust.

  • The test must resolve to TRUE or FALSE

    Comparisons such as A2>=70 work because Excel can evaluate them as logical values.

  • Omitting the false result is rarely clear

    If value_if_false is omitted and the test fails, Excel returns FALSE.

  • Deep nesting gets difficult quickly

    Nested IF formulas can be hard to audit. For many branches, consider IFS, SWITCH, lookup tables, or helper columns.

Need multiple tests? Combine IF with AND or OR when one decision depends on several conditions.

Intro IF practice problem

Solve the intro problem directly here, or open it on its own page.

Open full problem

Advanced IF practice problems

Use IF alongside other Excel functions in realistic, less-prescriptive challenges.

Budget Status Check

SUMIF IF
Easy ★☆☆
Pending

Duplicate Entry Flag

COUNTIFS IF
Medium ★★☆
Pending

Allow List Validation Pro problem

NOT COUNTIF IF AND OR EXACT
Medium ★★☆
Pending

Allow List Validation II Pro problem

NOT COUNTIF FIND ISNUMBER IF AND OR
Hard ★★★
Pending

City Target Status Pro problem

SUMIF IF
Easy ★☆☆
Pending

Code Approval Check Pro problem

EXACT TRIM IF AND
Medium ★★☆
Pending

Code Format Validator Pro problem

FIND IF MID VALUE ISNUMBER
Hard ★★★
Pending

Conditional Label Builder Pro problem

TEXTJOIN IF
Medium ★★☆
Pending

Document Submission Check Pro problem

COUNTA IF
Easy ★☆☆
Pending

Follow Up Date Code Pro problem

MINIFS WORKDAY TEXT IF
Hard ★★★
Pending

Group Score Flag Pro problem

AVERAGEIF IF
Medium ★★☆
Pending

Monthly Deals Quota Check Pro problem

COUNTIFS IF DATE MONTH YEAR
Hard ★★★
Pending

Promo Eligibility Check Pro problem

AND IF VLOOKUP XLOOKUP LEFT LEN
Hard ★★★
Pending

Quarterly Sales Metric Pro problem

AVERAGEIF AVERAGE IF IFERROR
Medium ★★☆
Pending

Score Compared To Middle Pro problem

MEDIAN IF IFS
Easy ★☆☆
Pending

Shipping Priority Check Pro problem

OR IF SEARCH ISNUMBER IFERROR
Hard ★★★
Pending

Spend Alert Levels Pro problem

ABS IFS IF
Easy ★☆☆
Pending

Student Admission Exams Pro problem

RANK IF SUM
Hard ★★★
Pending

Student Score Tier Pro problem

RANK IF IFS
Medium ★★☆
Pending

Team Bonus Window Pro problem

SUMIFS IF
Medium ★★☆
Pending

Training Requirements Status Pro problem

COUNT IF
Easy ★☆☆
Pending

Training Requirements Status II Pro problem

COUNTIF IF
Medium ★★☆
Pending

Update Item Codes Pro problem

SUBSTITUTE IF
Medium ★★☆
Pending

VIP Discount Calculation Pro problem

SEARCH IFERROR IF
Hard ★★★
Pending