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

  • 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, 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.

Score Compared To Middle

MEDIAN IF IFS
Easy ★☆☆
Pending

Promo Eligibility Check

AND IF VLOOKUP XLOOKUP LEFT LEN INDEX MATCH XMATCH
Hard ★★★
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

Budget Status Check Pro problem

SUMIF IF SUMIFS
Easy ★☆☆
Pending

Calendar Quarter Label Pro problem

CHOOSE MONTH ROUNDUP IF
Medium ★★☆
Pending

City Target Status Pro problem

SUMIF IF SUMIFS
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

Compounded Factors Pro problem

PRODUCT FILTER IFERROR IF COUNTIFS
Hard ★★★
Pending

Conditional Label Builder Pro problem

TEXTJOIN IF
Medium ★★☆
Pending

Document Submission Check Pro problem

COUNTA IF
Easy ★☆☆
Pending

Duplicate Entry Flag Pro problem

COUNTIFS IF
Medium ★★☆
Pending

Follow Up Date Code Pro problem

MINIFS WORKDAY TEXT IF IFERROR MIN FILTER
Hard ★★★
Pending

Group Score Flag Pro problem

AVERAGEIF IF AVERAGEIFS
Medium ★★☆
Pending

Median Call Time Pro problem

MEDIAN FILTER IF
Medium ★★☆
Pending

Monthly Deals Quota Check Pro problem

COUNTIFS IF DATE MONTH YEAR
Hard ★★★
Pending

Quarterly Sales Metric Pro problem

AVERAGEIF AVERAGE IF IFERROR
Medium ★★☆
Pending

Roster Readiness Check Pro problem

IF AND COUNT MIN
Medium ★★☆
Pending

Ship Date Pro problem

MAXIFS WORKDAY TEXT MAX IF
Hard ★★★
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