What it does
IF returns one value when a condition is true and another value when it is false.
Syntax or pattern
=IF(logical_test, value_if_true, value_if_false)5 practical examples
Pass or fail
Mark scores of 70 or more as Pass.
=IF(B2>=70, "Pass", "Fail")This is the most common IF pattern.
Show blank when incomplete
Only calculate when an input cell is filled.
=IF(A2="", "", B2*C2)This keeps reports clean while data is incomplete.
Bonus eligibility
Check whether sales reached the bonus target.
=IF(C2>=10000, "Bonus", "No bonus")Simple business rules are easy to express with IF.
Overdue status
Mark tasks as overdue when the due date has passed.
=IF(D2<TODAY(), "Overdue", "On track")Use TODAY for dynamic date logic.
Nested IF for levels
Assign Low, Medium or High based on a value.
=IF(B2<50, "Low", IF(B2<80, "Medium", "High"))For many levels, IFS or SWITCH may be easier to read.
Common mistakes to avoid
- Making nested IF formulas too hard to read.
- Comparing numbers stored as text.
- Forgetting quotation marks around text results.
Related Excel examples
FAQ
Can IF return a blank cell?
Yes, use an empty string such as "" for the true or false result.