Syntax, a live decision playground, the short-circuit rule that guards your divides, and a real-world error library: make every branch return exactly what you mean — and know when to reach for IFS instead.
IF runs a logical test and returns one of two values. It is the foundation of every conditional formula — and the building block you nest, combine with AND/OR, or replace with IFS when branches multiply.
Three arguments, two branches, one short-circuit rule. The gallery below is the mental model — load any row into the playground to watch the engine evaluate it live.
| logical_test | returns |
|---|---|
TRUE | value_if_true |
FALSE | value_if_false |
B2>=60 (92) | "Pass" |
B4>=60 (58) | "Fail" |
If you omit value_if_false, a FALSE test returns the logical value FALSE — not 0, not blank.
IF evaluates only the branch it returns. The unused branch is never computed — even if it would error.
=IF(TRUE(),"safe",1/0)"safe"=IF(FALSE(),"safe",1/0)#DIV/0!This is why nested IF guards a divide safely, while AND(B2<>0, A2/B2>1) does not — AND evaluates every argument.
| Nested IF | IFS | |
|---|---|---|
| Max depth | 64 levels | 127 pairs |
| Readability | pyramid | flat |
| Else / default | built-in | add TRUE() |
| Since | always | Excel 2016 |
Rule of thumb: ≤2 branches → IF; 3+ flat bands → IFS with a TRUE(),"default" tail.
Edit the score data or type any formula — the HyperFormula engine evaluates it instantly. Load a preset to see nesting, AND/OR, blank checks and the short-circuit rule in action.
14 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.
IF is universal; the modern helpers (IFS, SWITCH) are not. Where each lands across eight platforms.
| Platform | Support | Notes | Gotcha |
|---|
IF is the gateway. The full course walks the decision toolkit end to end — AND/OR/XOR, IFS & SWITCH, the IS* tests, and how to compose them with lookups without the classic short-circuit and blank-cell traps.