IF, nested IF, AND/OR, and IFS patterns
Every Excel hiring test and financial model relies on conditional logic. Once single-rule IF is automatic, combine it with AND, OR, or IFS for multi-tier scoring:
=IF(C4>=B4, "Bonus", "No bonus")Tests one condition and returns the 2nd argument if TRUE, or the 3rd argument if FALSE.
=IF(AND(C4>=B4, D4="Active"), "Bonus", "No bonus")Wrap multiple requirements in AND(...) inside the first argument of IF.
=IF(OR(C4>=B4, E4>=10), "Bonus", "No bonus")Returns "Bonus" when at least one test evaluates to TRUE.
=IF(C4>=6000, "Gold", IF(C4>=5000, "Silver", "Standard"))Evaluate thresholds from highest to lowest (or lowest to highest) so earlier rules do not swallow later ones.
=IFS(C4>=6000, "Gold", C4>=5000, "Silver", TRUE, "Standard")Modern alternative to nested IF. End with TRUE as the catch-all fallback so unmatched rows never return #N/A.
4 common IF formula mistakes
Using > instead of >=
"At least" or "met or beat" includes exact ties (5,000 vs 5,000). Using > leaves boundary rows out.
#NAME? from unquoted text
Writing =IF(C4>=B4, Bonus, "No bonus") makes Excel look for a named range called Bonus. Always wrap text outputs in double quotes.
Quoting numbers by mistake
Writing "100" instead of 100 returns text, which SUM will ignore downstream. Leave numeric outputs unquoted.
Swapping true and false branches
Argument 2 is always the TRUE result and argument 3 is always the FALSE result. Double-check the direction of < vs >=.
FAQ
What are the 3 arguments of the Excel IF function?
IF(logical_test, value_if_true, value_if_false). The first argument is a comparison such as C4>=B4, the second is what Excel returns when that test is TRUE, and the third is what Excel returns when it is FALSE.
When should I use IFS instead of nested IF?
Use IFS when you have three or more tiers (for example Gold, Silver, Standard) and you are on Excel 2019 or Microsoft 365. IFS avoids deeply nested closing parentheses. Always include a final TRUE fallback pair to prevent #N/A.
Why does my IF formula return #NAME??
Almost always because a text output (like Bonus) or text comparison is missing double quotes, or the function name is misspelled.
How do I test two conditions inside one IF formula?
Place AND(cond1, cond2) or OR(cond1, cond2) inside the logical_test argument — for example =IF(AND(C4>=B4, B4>0), "Bonus", "No bonus").