The IF Function in Excel
IF returns one value when a condition is true and another when it's false. It's the formula most people reach for first when they want Excel to make a decision — flagging pass/fail, over/under budget, or in-stock/out-of-stock — and it's the building block every more advanced logic formula (IFS, nested IF, IF combined with AND/OR) is built on.
Worked example
=IF(B2>=60, "Pass", "Fail")"Pass" if B2 is 60 or more, otherwise "Fail"
The three arguments are always: the condition, what to return if true, what to return if false.
Nesting IF for more than two outcomes
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","D"))) checks each threshold in order, falling through to the next IF only when the previous condition is false.
Past 3-4 levels deep, nested IF gets hard to read — that's when IFS or SWITCH (one condition, one result, repeated) becomes the clearer choice.
Combining IF with AND / OR
=IF(AND(B2>=60, C2="Submitted"), "Pass", "Fail") only returns "Pass" when both conditions hold — AND and OR go inside IF's first argument, they don't replace it.
Practice this for real
Try the "The IF Function" exercises
Type the formula into a real spreadsheet and get instant feedback.