IF Formula

=IF(logical_test, value_if_true, value_if_false)

The IF formula is one of Excel's most powerful logical functions. It allows you to test a condition and return different values depending on whether the condition is TRUE or FALSE.

How It Works

The IF function evaluates a logical test and returns one value if the condition is true, and another value if the condition is false. This makes it perfect for creating dynamic spreadsheets that respond to different scenarios.

Example

=IF(A1>10, "Over 10", "10 or less")

This formula checks if the value in cell A1 is greater than 10. If yes, it returns "Over 10", otherwise it returns "10 or less".

Common Use Cases

Grade Assignment: =IF(B2>=90, "A", "B")
Status Checking: =IF(C2="", "Pending", "Complete")
Bonus Calculation: =IF(D2>=E2, "Yes", "No")

🎯 Practice Task

  • Objective: Use the embedded Excel sheet below to practice the IF formula
  • Task: Fill in the Bonus Eligible? column using an IF formula
  • Logic: If Sales is greater than or equal to Target, return "Yes", otherwise return "No"
  • Formula Hint: =IF(B2>=C2, "Yes", "No")

Pro Tip: You can open the file in Excel Online by clicking the Excel icon in the embedded sheet. This will give you full editing capabilities to practice the formula!

Next Steps

Once you've mastered the basic IF formula, try exploring nested IF statements and combining IF with other functions like AND and OR for more complex logical tests. Check out the Logic Functions section in the sidebar for advanced techniques!