How it works.
The IF function lets you make logical comparisons between a value and what you expect. An IF statement has two results: the first is if your comparison is True, the second is if your comparison is False.
💡 In simple terms.
Checks whether a condition is true or false. If true, it outputs one value; if false, it outputs another.
"Think of this like a referee checking a score: IF the score is 70 or higher, they shout "Pass!"; otherwise, they shout "Fail!"."
Formula syntax.
Standard Excel Notation=IF(logical_test, value_if_true, [value_if_false])[like_this] are optional; all other arguments are required.Formula arguments.
Every parameter accepted by the IF function is detailed below.
A condition that can be evaluated to TRUE or FALSE.
Example value:C2>=70The value to return if logical_test evaluates to TRUE.
Example value:"Pass"The value to return if logical_test evaluates to FALSE.
Default: "Fail"Simple example.
Step-by-Step ScenarioPass/Fail Grade Check
Label student results as "Pass" if their score is 70 or above, otherwise "Fail".
| Student | Subject | Score | Status | Pass Threshold |
|---|---|---|---|---|
| Sophia | Math | 85 | — | 70 |
| Jackson | Math | 62 | — | — |
| Lucas | Math | 74 | — | — |
=IF(C2>=70, "Pass", "Fail")Evaluates IF over the sample table cells, placing the verified output in cell D2:D6.
Formula generator.
Full Generator WizardCustomize the argument fields below to generate a tailored IF formula ready to paste directly into your worksheet.
=IF()Expected result behavior.
Returns "Pass" based on sample evaluation criteria and active cell references.
Best Practices
- You can nest multiple IF statements inside each other to handle more than two outcomes, although the IFS function is now preferred.
- To leave a cell blank on FALSE, use empty quotes: "" as the value_if_false.
Common Mistakes
- Avoid nesting more than 3-4 IF functions, as they become extremely hard to debug and maintain. Consider using IFS or VLOOKUP/XLOOKUP tables.
Platform & version compatibility.
Verified platform compatibility matrix based on actual spreadsheet calculation engine specifications.
Core standard function supported across all modern and legacy Microsoft Excel versions (365, 2021, 2019, 2016, 2013, 2010), as well as Excel for the Web and Mac.
100% compatible with Google Sheets. Uses identical argument order, data types, and standard calculation logic.
Frequently asked questions.
Technical Q&AHow many IF statements can be nested in modern Excel?↓
Modern Excel allows up to 64 nested IF statements, but using IFS, SWITCH, or XLOOKUP is strongly recommended for readability and performance.
How do I check multiple conditions inside an IF statement?↓
Combine IF with logical functions AND or OR, for example: =IF(AND(A2>50, B2="Approved"), "Qualify", "Disqualify").