The Excel OR function, explained interactively.
OR combines up to 255 logical tests into a single TRUE/FALSE result: it returns TRUE if any argument is TRUE. Only when every argument is FALSE does OR return FALSE. It’s the universal any-of-many filter — IF(OR(state="NY", state="CA"), "Priority", "Standard") — and the complement to AND: where AND demands every test pass, OR is happy with a single pass.
How to use OR
Pass two or more logical tests — OR returns TRUE when any one is TRUE. Open the playground below to watch the result flip the moment any single path qualifies.
- Type
=OR(and supply the first logical test — a comparison likeB2="NY", a cell reference holding TRUE or FALSE, or any formula returning a boolean. - Add a comma and the next logical test. Each one represents an alternative path — any one passing means the whole formula passes. OR accepts up to 255 arguments.
- Close the parenthesis. OR walks the arguments and returns TRUE when the first match is found (semantically; note that Excel evaluates every argument, not just up to the first TRUE).
- Wrap with IF to branch on the result:
=IF(OR(A2="NY", A2="CA"), "Priority", "Standard").
TRUE if any argument is TRUE. Only when every argument is FALSE does OR return FALSE. Accepts 1 to 255 logical arguments.| A | B | C | |
|---|---|---|---|
| 1 | Name | Score | Age |
| 2 | Ava | 85 | 16 |
| 3 | |||
| 4 | OR result | TRUE | |
B2>=90 → FALSE · C2<=16 → TRUE → OR = TRUE. The age path qualified — OR accepts any single TRUE.OR syntax and arguments
One required logical test plus up to 254 additional. See Microsoft’s official OR reference.
B2="NY", a cell/formula returning TRUE/FALSE, or a number. Zero counts as FALSE, any non-zero as TRUE. Empty cells count as FALSE without error.- OR does not short-circuit — even after finding a TRUE it evaluates every remaining argument. Expensive tests run regardless of whether an earlier one already qualified.
- Non-boolean text that isn’t literal
"TRUE"or"FALSE"returns#VALUE!. - Passing a range collapses to one boolean:
OR(A2:A10)is TRUE if any cell in the range is truthy. Empty cells inside the range count as FALSE. - Array-constant form:
=OR(A2={"NY","CA","TX"})compares A2 against each element. Short and readable for long whitelists.
OR examples
Four recurring patterns: whitelist filter, IF(OR(…)) labeling, mixed-type alert, and OR nested with AND.
Example 1: OR for a simple whitelist
The cleanest any-of-many pattern. Returns TRUE if the value matches any of the named alternatives — a bare boolean suitable for helper columns or conditional formatting rules.
Returns TRUE for NY or CA customers. Extend the list with more comparisons, or switch to the array-constant form for longer whitelists: =OR(B2={"NY","CA","TX","FL"}).
Example 2: IF(OR(…)) — region labeling
The region-tagging pattern. IF branches on the OR result to produce human-readable labels — "Priority" for the matching states, "Standard" for everyone else. A single formula drives an entire label column.
Drop-in replacement for a chain of nested IFs when every alternative produces the same output. Widely used in CRM, sales, and customer-segmentation dashboards.
Example 3: OR across mixed numeric and text conditions
OR doesn’t care what kind of test you pass — as long as each argument resolves to a boolean, it combines them. Alert if stock is low or the product is discontinued: two different signal types collapsed into one flag.
Returns TRUE when either is true — or both. Perfect for inventory sync flags, lifecycle warnings, and anomaly detection columns.
Example 4: OR nested with AND — mixed eligibility
Real admission rules rarely reduce to pure OR or pure AND. Nesting them expresses compound logic naturally: accept if exceptional score OR (good score AND scholarship track).
Chloe (72, Scholar) is accepted via the AND path; Dev (93, Regular) via the direct score path. Two alternative admission criteria in a single cell.
Common OR errors and fixes
One visible error, two silent surprises that look fine until you audit.
OR returns #VALUE! on non-logical text
Cause: an argument is text that can’t be coerced to a boolean — a free-form string like "hello" or a stray word that should have been compared. Literal "TRUE"/"FALSE" strings and numbers pass through fine; arbitrary text errors.
To fix: wrap the text in a comparison (A2="YES") or swap in a proper boolean column upstream. Empty cells silently count as FALSE and do not trigger this error — only unrecognised text does.
OR of an empty range is FALSE — no matches, vacuously false
Cause: an empty range or a range of all blanks makes =OR(A2:A10) return FALSE. For OR this feels intuitive (nothing truthy = nothing TRUE), but it’s symmetric to AND of an empty range returning TRUE — a surprise if you’re wiring OR into a guard.
If you genuinely need to distinguish "empty" from "all FALSE", add a count guard: =IF(COUNTA(A2:A10)=0, FALSE, OR(A2:A10)). Or avoid passing ranges — use explicit arguments where the intent lives in the formula text.
OR doesn’t short-circuit — every argument still runs
Cause: Excel evaluates every argument even after finding a TRUE. A slow VLOOKUP or expensive SUMPRODUCT in a later slot still runs, even when an earlier cheap test already made OR return TRUE.
For real short-circuit semantics, nest IF around OR: =IF(B2="NY", TRUE, OR(C2="CA", VLOOKUP(…))). The outer IF skips the OR branch entirely when the cheap test already qualifies. Useful when audit-logging formulas show thousands of unnecessary sub-calls.
OR vs AND, NOT, and IF logic
OR is one of four boolean building blocks. Knowing which to reach for keeps formulas readable.
| Function | Returns TRUE when… | Typical use | Short-circuit? |
|---|---|---|---|
OR | Any argument is TRUE | Whitelists, either-or gates, alternative paths | No — evaluates all args |
| AND | Every argument is TRUE | Approval gates, compound validation | No |
NOT | The single argument is FALSE | Inverting, blacklists, exclusions | N/A — single argument |
| IF | (returns one of two branches) | Branching on an OR/AND result to produce labels or further formulas | Yes — only the taken branch runs |
SUMPRODUCT with + | Conditions added together produce a non-zero array entry | Array-aware OR inside conditional sums | No |
Rule of thumb: reach for OR inside IF when any of several categories should trigger a label; reach for AND when all conditions must pass; nest them when real rules mix both. OR collapses down to a single boolean — for array-aware OR logic inside conditional sums, add boolean expressions together with + inside SUMPRODUCT.
OR frequently asked questions
6.01What does OR do in Excel?▸
OR takes up to 255 logical arguments and returns TRUE if any one of them is TRUE. It returns FALSE only when every argument is FALSE. The classic pattern is IF(OR(condition1, condition2), "yes", "no") — any matching condition triggers the yes branch.
6.02How is OR different from AND?▸
AND requires every argument to be TRUE; OR requires only one. Use AND for compound requirements that must all hold (score AND age both pass); use OR for alternative paths (express shipping OR prime member). They’re frequently nested — =AND(OR(A=1, A=2), B>0) means "A is 1 or 2 AND B is positive".
6.03How do I combine OR with IF in Excel?▸
Wrap OR inside IF as the logical_test: =IF(OR(B2="NY", B2="CA"), "Priority", "Standard"). OR broadens the IF gate so any one of several alternatives produces the first branch. This is the standard whitelist pattern — match-one-of-many.
6.04Why does OR return #VALUE!?▸
OR returns #VALUE! when an argument is text that can’t be interpreted as a boolean. Free-form strings like "hello" error; literal "TRUE" / "FALSE" (case-insensitive), numbers (0 = FALSE, non-zero = TRUE), and comparisons work. Empty cells are treated as FALSE, not as errors.
6.05How many conditions can OR take?▸
Up to 255 logical arguments. When listing many alternatives against the same value, =OR(A2={"NY","CA","TX"}) with an array constant is often more concise than spelling out each comparison. Google Sheets uses the same limit and syntax.
6.06Does OR work the same in Google Sheets?▸
Yes. OR has an identical signature and behavior in Google Sheets — accepts up to 255 arguments and returns TRUE when any are TRUE. Empty-cell handling, error propagation, and nested IF patterns all match. Formulas written in either product port directly to the other.
Microsoft Excel is a registered trademark of Microsoft Corporation. Google Sheets is a trademark of Google LLC. Formula Gym is not affiliated with, endorsed by, or sponsored by either company.