IF Formula Generator
Describe the test and what to show for true and false, and get the IF formula — including the AND and OR combinations people usually get wrong.
When to use IF
- Labelling rows as pass or fail, over or under, flagged or clear
- Showing something readable in a report instead of a raw number
- Two conditions that both have to hold, or either one of them
How the formula works
Taking the example on this page apart, piece by piece:
=IF(B2>=50,"Pass","Fail")
B2>=50The test. Excel checks whether B2>=50 is true.
"Pass"Returned when the test is true. Text goes in quotes; numbers and cell references do not.
"Fail"Returned when the test is false.
Where it goes wrong
Nesting IFs when the bands are ordered
Four nested IFs still work, but they are hard to read and easy to get out of order. Once the tiers are ranges rather than cases, IFS or a lookup table is clearer.
Quoting numbers
Returning a quoted 1 rather than a bare 1 gives you text that looks like a number, and the total below it silently ignores it.
Assuming an empty-looking cell is blank
A cell holding a formula that returns an empty string is not blank. ISBLANK and a comparison against empty text disagree about it, which is where the confusion starts.
Practise it
A generator gives you the formula. These give you the reason it works — and tell you which assumption broke when it does not.
- Flag reps below target with IF · beginner
- Approve orders with AND · intermediate