Skip to content

OR

Returns TRUE when at least one condition you give it is true. Use it inside IF to accept any of several cases.

Syntax

=OR(, [logical2], ...)

Logical

Every version of Excel, including Microsoft 365, Excel 2024, 2021, 2019, 2016 and earlier, Excel for the web and the mobile apps.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
D
1
Order
Region
Zone
2
O-1
West
Coastal
3
4

C2 =IF(OR(B2="East",B2="West"),"Coastal","Inland") returns Coastal

How OR works

OR checks several conditions and returns TRUE if any of them is true. It returns FALSE only when every condition is false. Like AND, it is mostly used inside IF: =IF(OR(A2="East", A2="West"), "Coastal", "Inland").

The arguments

Each argument is a condition: a comparison such as A2="East" or B2>1000, a cell or formula that returns TRUE or FALSE, or a range of such values. You can give up to 255.

  • A number is treated as TRUE unless it is zero.
  • Text and empty cells inside a range argument are ignored. If every argument is text or empty, OR returns #VALUE!.
  • If any argument is an error, OR returns that error, even if another argument is already true. OR doesn't stop at the first true condition.

OR with a range

=OR(A2:A9="Late") is TRUE if any cell in the range equals "Late". It is a handy "does this appear anywhere" test. In Microsoft 365 and Excel 2021 or later it works as a normal formula. In older versions, enter it as an array formula with Ctrl+Shift+Enter.

A long list of values: use COUNTIF or a lookup

Testing one cell against many values makes OR long: =OR(A2="N", A2="S", A2="E", A2="W"). For more than a handful, a shorter test is =COUNTIF(F2:F9, A2)>0, where F2:F9 holds the accepted values, or =ISNUMBER(MATCH(A2, F2:F9, 0)). Both put the list in cells, where it is easy to maintain.

OR does not work row by row

OR over a column returns a single TRUE or FALSE, not one answer per row. To flag each row, write the test on each row and fill down. To get an array of 1s and 0s, add conditions: =(A2:A9="East")+(A2:A9="West") returns 1 for each row that is East or West.

Combining with AND and NOT

  • =AND(B2>0, OR(C2="Key", D2>1000)) requires B2 above zero, plus either of two conditions. Without the brackets, the logic changes.
  • =NOT(OR(...)) is true when none of the conditions hold, and is equivalent to AND of the opposites.
  • XOR is true when an odd number of conditions are true, which suits "one or the other, but not both".

Common uses

  • Accept several spellings or codes: =OR(A2="Yes", A2="Y").
  • Flag a row that breaks any rule: =IF(OR(B2<0, C2="", D2>100), "Check", "OK").
  • Combine date tests: =OR(A2<DATE(2025,1,1), A2>DATE(2025,12,31)) is true when a date falls outside 2025.

Keep each OR short enough to read. Past four or five conditions, move the list into cells.

Arguments

logical1
The first condition, such as A2="East", or a range of TRUE/FALSE values. A number counts as true if it isn't zero.
logical2, ...optional
More conditions, up to 255. OR returns TRUE if at least one is true, and FALSE only if all are false. Text and empty cells inside a range are ignored. If no argument holds a logical value, OR returns #VALUE!.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Either condition is enough

C2 =IF(OR(B2="East",B2="West"),"Coastal","Inland")

Result: Coastal

B2 is West, so the second test is true and OR returns TRUE. IF then returns "Coastal". Only a region that is neither East nor West would give "Inland".

C2
A
B
C
D
1
Order
Region
Zone
2
O-1
West
Coastal
3
4

C2 =IF(OR(B2="East",B2="West"),"Coastal","Inland") returns Coastal

Example 2

Flag a row that breaks any rule

D2 =IF(OR(B2<=0,C2="",B2>10000),"Check","OK")

Result: Check

The customer is blank, so C2="" is true and OR returns TRUE, even though the amount is in range. Any one failed rule is enough.

D2
A
B
C
D
E
1
Invoice
Amount
Customer
Status
2
INV-8
420
Check
3
4

D2 =IF(OR(B2<=0,C2="",B2>10000),"Check","OK") returns Check

Example 3

Is a date outside the year?

B2 =OR(A2<DATE(2025,1,1),A2>DATE(2025,12,31))

Result: TRUE

46030 is 8 January 2026, which is later than 31 December 2025, so the second test is true. Dates are serial numbers, so they compare like numbers.

B2
A
B
C
D
1
Invoice date
Outside 2025?
2
08-Jan-2026
TRUE
3
4

B2 =OR(A2<DATE(2025,1,1),A2>DATE(2025,12,31)) returns TRUE

Example 4

Does a status appear anywhere in a range?

C2 =OR(A2:A5="Late")

Result: TRUE

The comparison is made for each cell in the range, and OR is TRUE if any of them is true. Delivery 3 is late.

C2
A
B
C
D
1
Delivery status
Any late?
2
On time
TRUE
3
On time
4
Late
5
On time
6
7

C2 =OR(A2:A5="Late") returns TRUE

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In E2, return Yes when the region in column B is East or West, and No otherwise. Fill down to E8.

Answer in E2, then it fills down to E8.

E2
A
B
C
D
E
F
1
Order
Region
Amount
Priority
Coastal?
Flag
2
O-01
North
4,200
Standard
3
O-02
East
1,350
Urgent
4
O-03
West
12,800
Standard
5
O-04
South
760
Standard
6
O-05
East
5,120
Standard
7
O-06
North
9,900
Urgent
8
O-07
South
10,000
Standard

Common mistakes

  • OR returns one TRUE or FALSE, never one result per row. Fill a row-level test down, or add conditions to get an array.
  • OR doesn't stop at the first true condition. An error in any argument is returned even when another argument is true.
  • Mixing AND and OR without brackets changes the meaning. Write AND(B2>0, OR(C2="Key", D2>1000)), and check it with a case that should fail.
  • Text and empty cells inside a range are ignored, and if nothing logical remains, OR returns #VALUE!.
  • Long OR chains against one cell, such as eight region codes, are fragile. Put the accepted values in cells and use COUNTIF or MATCH.

Questions people ask

How do I use OR with IF?

Put OR in IF's first argument: `=IF(OR(A2="East", A2="West"), "Coastal", "Inland")`. IF returns the second argument when any condition inside OR is true.

What is the difference between OR and AND?

OR is true when at least one condition is true. AND is true only when every condition is true.

How do I test a cell against a long list of values?

Put the values in a range and use `=COUNTIF(F2:F9, A2)>0` or `=ISNUMBER(MATCH(A2, F2:F9, 0))`. It is shorter than a long OR and easier to update.

Can OR check a whole range?

Yes. `=OR(A2:A9="Late")` is TRUE if any cell in the range is "Late". In Excel 2019 and earlier, enter it with Ctrl+Shift+Enter.

Why does OR return #VALUE!?

None of its arguments produced a logical value. This happens when you give it only text or only empty cells. Make sure each argument is a comparison.

Learn OR in a real sheet.

OR is taught in Logic and text, lesson 2: AND and OR inside IF. Each lesson is a short, graded exercise like the one above.