The OR function
OR checks several conditions and returns TRUE if *any* of them pass. It only returns FALSE when every single condition fails.
It's ideal for rules with alternatives: free delivery for big orders or members, a discount for students or pensioners.
=OR(logical1, [logical2], ...)
Arguments
- logical1
- The first condition, such as
B2>=40. - logical2, ...optional
- More conditions. If any one of them is TRUE, OR returns TRUE.
Try it
=OR(B2>=40,C2="Yes") in D2. Ruby isn't a member, but her order is over £40, so one condition passes and OR returns TRUE.
D2
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Customer | Order total | Member | Free delivery | |
| 2 | Ruby | £52.00 | No | TRUE | |
| 3 | Theo | £18.50 | Yes | ||
| 4 | Zara | £23.99 | No | ||
| 5 | Alfie | £40.00 | No | ||
| 6 | |||||
| 7 |
Edit the formula in D2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =OR(B3>=40,C3="Yes") | TRUE | Theo's order is small, but he's a member. |
| =OR(B4>=40,C4="Yes") | FALSE | Zara meets neither condition. |
| =IF(OR(B4>=40,C4="Yes"),"Free","£3.95") | £3.95 | Inside IF, OR picks the delivery charge. |
| =IF(OR(B5>=40,C5="Yes"),0,3.95) | 0 | £40 exactly counts, because the test is >=. |
Tips
- To test one cell against several values, repeat the cell each time:
=OR(C2="Gold",C2="Silver"). - Mix OR and AND for rules like "over £40, or a member who spent at least £20":
=OR(B2>=40,AND(C2="Yes",B2>=20)).
Common mistakes
- `=OR(C2="Gold","Silver")` gives #VALUE!.Each condition must be a full comparison. Write
=OR(C2="Gold",C2="Silver"). - OR is TRUE for every row.One of the conditions is always true, such as
B2>0. Check each part on its own.
Practise OR with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.