IF, AND and OR formulas
IF(test, value_if_true, value_if_false) returns one of two results. AND is true only when every test is true, OR when at least one is, and NOT reverses a test. Put the strictest test first when you nest them.
Last updated 23 November 2026
| A | B | C | |
|---|---|---|---|
| 1 | Store | Sales | |
| 2 | Store 1 | 120 |
In C2, write =IF(B2>=150,"High",IF(B2>=80,"Medium","Low")) and it shows Medium.
Building a condition
A test compares two things: B2>=50, A2="Yes", C2<>"". Text goes in quotation marks and is compared without regard to case. To test two things at once, put them inside AND or OR: IF(AND(B2>=18,C2>=60),"Eligible","Not eligible").
Nesting in the right order
IF tests run in order and the first true one wins. For three bands, test the highest first: IF(B2>=150,"High",IF(B2>=80,"Medium","Low")). Testing the lowest first would send every large number to the first answer.
IFS takes pairs of a test and a result and returns the first true one. It reads more cleanly than a deep nest, and TRUE as the last test works as an else.
Boundaries and errors
- >= includes the number you wrote and > does not. Check the edge value, such as a score of exactly 50.
- IFERROR(value, replacement) catches errors such as #DIV/0!, which makes it the usual way to avoid dividing by zero.
Practise it
Module 2, Logic, has 20 tasks on this, each checked on hidden data: open module 2. You can also try formulas in the sandbox.