OR
At least one test has to hold.
Check whether at least one of several conditions holds
TRUE when any test is TRUE, FALSE only when none of them are
Syntax
=OR(test1, [test2], ...)
| Argument | Required | What goes here |
|---|---|---|
test1 | Required | A comparison that may be true. |
test2 | Optional | A comparison that may be true. |
How to use OR
OR returns TRUE as soon as one of its tests holds. Every test has to fail for it to return FALSE.
It is how a rule covers several spellings of the same situation: a row that is either overdue or queried is a row somebody has to look at.
OR and AND nest inside each other freely. The pattern worth recognising is OR inside AND, which reads as "any of these, and also this".
As with AND, the useful form is inside an IF or a formatting rule rather than on its own.
Examples
Every result below is worked out by the same evaluator that marks your answers, on the sheet shown here.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Invoice | Supplier | Status | Days overdue | Amount | Supplier | Terms (days) | |
| 2 | INV-8801 | Brightwell Paper | Overdue | 12 | 940 | Ashgrove Catering | 30 | |
| 3 | INV-8802 | Calder Utilities | Queried | 47 | 1180 | Brightwell Paper | 30 | |
| 4 | INV-8803 | Meridian Freight | Overdue | 63 | 2450 | Calder Utilities | 14 | |
| 5 | INV-8804 | Ashgrove Catering | On terms | 0 | 405 | Meridian Freight | 45 | |
| 6 | INV-8805 | Brightwell Paper | Overdue | 38 | 760 | Thornbury Print | 60 | |
| 7 | INV-8806 | Thornbury Print | Overdue | 91 | 1320 | |||
| 8 | INV-8807 | Meridian Freight | On terms | 0 | 580 | |||
| 9 | INV-8808 | Calder Utilities | Overdue | 24 | 215 |
| Formula | Result |
|---|---|
=OR(C3="Overdue",C3="Queried")Queried is one of the two, so TRUE. | TRUE |
=OR(C5="Overdue",C5="Queried")On terms is neither, so FALSE. | FALSE |
=IF(OR(D9>60,E9>2000),"Escalate","Normal")Twenty-four days and two hundred and fifteen pounds. Neither test holds. | Normal |
=IF(OR(D4>60,E4>2000),"Escalate","Normal")The same rule on a row where both happen to hold. OR only needed one of them. | Escalate |
Notes
- OR is not exclusive. Both tests holding is still TRUE.
- A long OR listing many values is usually better written as a lookup against a list.
Related
A reference tells you what it does. A unit makes you use it.