Wauvel

Excel like a finance pro.

The functions, VBA, and shortcuts a finance operator actually uses — curated, with CFO examples. Prefer them pre-built? Grab a ready-made model.

← All functions

IF

Logic & error handling

The workhorse of logic — return one thing when a test is true, another when it's false.

Difficulty

Beginner
Excel file

1What is it?

IF checks a condition and returns one value if it's true and a different value if it's false. It's the single most important logic function: the moment a cell needs to react to what's in another cell — flag it, label it, switch a number — you reach for IF. The three parts are the test, the true result, and the false result. You can nest IFs for a few branches, but past two or three it gets hard to read, which is exactly what IFS and SWITCH are for.

2What it looks like

IF(logical_test, value_if_true, value_if_false)
logical_test
A condition that comes out TRUE or FALSE, like B2>0 or A2="Paid".
value_if_true
What to return when the test is TRUE.
value_if_false
What to return when the test is FALSE.

3When you use it

  • Flag a row: =IF(B2>90, "Over 90 days", "Current").
  • Return a number conditionally: =IF(A2="Refund", -B2, B2).
  • Guard a divide: =IF(B2=0, 0, A2/B2) to avoid #DIV/0!.

4See it in action

Change the inputs — the formula and result update live. Prefer the real thing? Download the Excel file and open it in Excel.

Compare revenue (B2) to the target (B3) and return one of two labels.

C2
fx
=IF(B2>=B3, "Hit target", "Missed")Hit target
ABC
1FieldValueResult
2RevenueHit target
3Target

The lime cell holds the formula — click it (or any cell) to see its contents in the bar above, just like Excel. Edit the blue cells to watch it recompute.

5Common errors

Text acts weirdYou compared text without quotes, or the case/spacing differs.

Fix: Put text in quotes ("Paid") and TRIM stray spaces; IF's text comparison ignores case but not extra spaces.

Nested too deepFive or six IFs are stacked inside each other.

Fix: Switch to IFS (for ranges) or SWITCH (for exact matches) — far more readable.

Always one branchThe test never evaluates the way you expect (number vs text).

Fix: Check the tested cell's type — 1 and "1" aren't equal.

6Better functions & alternatives

  • IFS Several conditions in order without nesting.
  • SWITCH Match one value against a list of exact cases.
  • AND / OR / NOT Combine multiple conditions inside a single IF test.
  • IFERROR The specialized IF for catching errors specifically.

Want IF already wired into a model? Wauvel's free tools download as branded, formula-driven Excel.

Learn the moves here — or let Wauvel run them on your numbers.

Get my free report →