Cellwise Try it free

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.

ABCD
1TicketPriorityDays openCustomer
2T-881High1Acme Co
3T-882Low9Brightline
4T-883Medium2Northwind
5T-884Low3Acme Co
  1. =OR(B2="High",C2>7)

    Result: TRUE

    T-881 is High priority, so OR returns TRUE even though it is only 1 day old.

  2. =OR(B4="High",C4>7)

    Result: FALSE

    T-883 is Medium and 2 days old. Neither test passes, so OR returns FALSE.

  3. =IF(OR(B3="High",C3>7),"Escalate","OK")

    Result: Escalate

    T-882 is low priority but 9 days old, so it gets escalated.

  4. =OR(D5="Acme Co",D5="Northwind")

    Result: TRUE

    Checks whether the customer is one of two key accounts.

How to use OR

  1. List the conditions where any one is enough.
  2. Type =OR( and enter each condition separated by commas.
  3. Close the bracket to get TRUE or FALSE.
  4. 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

Related functions

Updated