How to Use the IF Function in Excel (With Real Examples)
Excel's IF function is one of the most commonly used logical formulas. It allows you to return specific results based on whether a condition is TRUE or FALSE.
🔹 What is the IF Function?
The IF function checks a condition and returns one value if it's TRUE, and another if it's FALSE.
🔹 Syntax:
=IF(logical_test, value_if_true, value_if_false)
Example: =IF(B2>=40, "Pass", "Fail")
🔹 Example 1: Pass or Fail Based on Marks
Assume column B has student scores. You want to return "Pass" if the score is 40 or above, else "Fail".
=IF(B2>=40, "Pass", "Fail")
🔹 Example 2: Check for Country
If column A has country names, use IF to check if the country is India:
=IF(A2="India", "Yes", "No")
🔹 Bonus: Nested IF Example
=IF(B2>=75, "Distinction", IF(B2>=40, "Pass", "Fail"))
🔹 Real-Life Use Cases
- Creating student result sheets
- Checking inventory stock level
- Conditional customer follow-up status
🔹 Excel Tip
Combine IF with functions like AND()
, OR()
for more powerful checks.
✅ Conclusion
The IF function is the first logical formula you should master in Excel. Try these formulas on your own data, and explore how it can help automate decisions.
📥 Download free Excel template with IF examples. (Coming soon)
For more insights and Excel learning, follow ScriptDataInsights.
Comments
Post a Comment