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.
IF syntax & arguments
Syntax
=IF(logical_test, value_if_true, [value_if_false])
-
1
logical_test
RequiredThe test Excel evaluates as TRUE or FALSE, such as
A2>=70. -
2
value_if_true
RequiredThe result to return when
logical_testis TRUE. -
3
value_if_false
OptionalThe result to return when
logical_testis 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>=70work because Excel can evaluate them as logical values. -
Omitting the false result is rarely clear
If
value_if_falseis 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.
Advanced IF practice problems
Use IF alongside other Excel functions in realistic, less-prescriptive challenges.
Budget Status Check
Duplicate Entry Flag
Allow List Validation
Allow List Validation II
City Target Status
Code Approval Check
Code Format Validator
Conditional Label Builder
Document Submission Check
Follow Up Date Code
Group Score Flag
Monthly Deals Quota Check
Promo Eligibility Check
Quarterly Sales Metric
Score Compared To Middle
Shipping Priority Check
Spend Alert Levels
Student Admission Exams
Student Score Tier
Team Bonus Window
Training Requirements Status
Training Requirements Status II
Update Item Codes
VIP Discount Calculation