IF Function
The IF Function: Making Decisions
Adding Logical Intelligence to Your Data
The IF function is one of the most powerful tools in Excel. It allows the spreadsheet to "think" by checking if a specific condition is met and then providing different results based on the outcome.
How the IF Function is Built
=IF(logical_test, [value_if_true], [value_if_false])
Common Logical Tests
To use the IF function, you need to know how to compare values:
| Operator | Meaning | Example |
| > | Greater Than | A1 > 50 |
| < | Less Than | A1 < 10 |
| >= | Greater Than or Equal To | B2 >= 35 |
| <> | Not Equal To | C1 <> "Pending" |
🛠️ Example: Student Pass/Fail
=IF(B2 >= 35, "Pass", "Fail")
- The Test: Is the value in B2 greater than or equal to 35?
- True: If yes, Excel displays the word "Pass".
- False: If no, Excel displays the word "Fail".
⚠️ The "Quotation Marks" Rule
In Excel formulas, any Text must be wrapped in double quotation marks (e.g., "Pass").
However, Numbers and Cell References should NOT have quotes.
Correct: =IF(A1 > 10, 100, 0)
Incorrect: =IF(A1 > "10", "100", "0")
💡 Skill Eco Pro-Tip: Visual Feedback
Use the IF function to highlight missing work! You can write a formula like =IF(A1="", "INPUT REQUIRED", "Done") to make sure your team knows exactly where data is still needed.