IF logic: condition → action, else → fallback
IF logic means: if a condition is true, do one thing; otherwise, do something else. The exam trap is confusing which branch runs when the condition is false.
Écouter cette page (bêta)
IF logic is a decision rule: you check a condition — like a cell value being over 100 — and if it is true, you run one action (e.g., apply a discount). If the condition is false, you run a different action (e.g., no discount). The key contrast is that the 'else' branch only fires when the condition is not true, not when it is missing or unknown. In spreadsheets, this maps directly to the IF function: =IF(A1>100, "Discount", "No Discount").
To avoid mixing up branches, picture a fork in the road: the true path goes left, the false path goes right. A quick test: read the condition aloud and say what happens when it is true, then what happens when it is false. In exam questions, watch for nested IFs — the inner condition only runs if the outer one is true. Also, remember that 'else' is optional; without it, nothing happens on false.
For a memory trick, think of a traffic light: green (true) means go, red (false) means stop. To test yourself, write a simple IF statement for a real rule, like 'if it rains, take an umbrella; else, wear sunglasses'. Then swap the condition to check you get the opposite result.
What does IF logic express?
A rule where one action or result follows if a condition is true, and another if it is false.