Logic function
Excel OR function
OR checks several conditions and returns TRUE if any one of them is true. It returns FALSE only when every test fails. Pair it with IF to flag rows that match any of a few rules.
=OR(logical1, [logical2], ...)Arguments
logical1- The first condition to check.
logical2- More conditions. You can check up to 255 in total.
OR examples
Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Ticket | Priority | Days open | Customer |
| 2 | T-881 | High | 1 | Acme Co |
| 3 | T-882 | Low | 9 | Brightline |
| 4 | T-883 | Medium | 2 | Northwind |
| 5 | T-884 | Low | 3 | Acme Co |
Result: TRUE
T-881 is High priority, so OR returns TRUE even though it is only 1 day old.
Result: FALSE
T-883 is Medium and 2 days old. Neither test passes, so OR returns FALSE.
Result: Escalate
T-882 is low priority but 9 days old, so it gets escalated.
Result: TRUE
Checks whether the customer is one of two key accounts.
How to use OR
- List the conditions where any one is enough.
- Type =OR( and enter each condition separated by commas.
- Close the bracket to get TRUE or FALSE.
- Wrap it in IF to return a label like "Escalate".
Common OR mistakes
Writing B2="High" OR "Medium"
Each test needs the full comparison: OR(B2="High",B2="Medium").
Confusing OR with AND
OR is TRUE when any test passes. If all tests must pass, use AND.
Long lists of the same cell
For many allowed values, =OR(B2={"High","Urgent","P1"}) is shorter than repeating B2.
OR FAQ
How do I use IF with OR in Excel?
Put OR inside IF: =IF(OR(A2="Yes",B2>100),"Flag",""). IF returns "Flag" when either condition is true.
Can I use AND and OR together in Excel?
Yes. Nest one inside the other: =AND(A2="Sales",OR(B2>5,C2="Lead")) needs Sales plus at least one of the other two.
How do I check if a cell equals one of several values?
Use OR with an array constant: =OR(A2={"Red","Blue","Green"}). It returns TRUE if A2 matches any of them.
Practice OR in these lessons
Guides that use OR
- Excel IF statement with multiple conditions
- If a cell contains text, return a value in Excel
- How to use IF with AND and OR in Excel
- How to use IFERROR in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Related functions
ANDTrue if all tests are trueNOTFlips TRUE and FALSEIFPicks a result from a testIFSFirst true test wins
Updated