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.
Here are some ideas for you
Optional resources that may help if you are learning formulas, building reports, or working in spreadsheets often.
- Excel formula booksSee ideas
Practice formulas with structured examples you can keep beside your desk.
- Excel shortcut guidesSee ideas
Build speed with keyboard shortcuts for selection, formatting and navigation.
- Numeric keypadsSee ideas
Helpful if you enter many numbers on a laptop or compact keyboard.
- External monitorsSee ideas
Useful for viewing large worksheets, formulas and reference tables side by side.
- Desk notebooksSee ideas
Sketch formula logic, report ideas and table structures before building.
- Laptop standsSee ideas
Make long spreadsheet sessions more comfortable and ergonomic.
Some links in this section may be affiliate links. Choose only what is useful for your own work.