fxExcelReps
PRO

You've used your 3 free functions

To practise OR and every other function, get a PRO subscription.

  • Unlimited access to every function
  • New functions and exercises every month
  • Every mistake explained + full solutions

Your free functions — you can always come back to these:

← All functions

How to use OR in Excel

OR returns TRUE when at least one condition is true. Combine it with IF to accept several alternatives.

Syntax

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

logical1The first condition.
[logical2], …More conditions.

Examples

=OR(B2>=10000, C2>=5)Top seller or senior employee.
=IF(OR(A2="Sat", A2="Sun"), "Weekend", "Weekday")Weekend check.
=OR(B2:B10>100)Is any value above 100? (array check)

OR inside IF: any one condition is enough

OR returns TRUE as soon as one condition is met. Inside IF it's the classic way to flag exceptions.

=IF(OR(C2>30, D2="Disputed"), "Follow up", "")Flags invoices that are late or disputed.
=IF(OR(B2="", C2=""), "Missing data", "OK")Catches a row where either field is empty.

Is the value one of a list?

Repeating the cell in every condition gets long. With more than three or four options, keep the list in cells and compare with the whole range.

=OR(A2="EUR", A2="USD", A2="GBP")TRUE when the currency is one of the three.
=OR(A2=$H$2:$H$10)TRUE when A2 appears anywhere in H2:H10.
=COUNTIF($H$2:$H$10, A2)>0The same check with COUNTIF, which works the same in every version.

Common mistakes

Repeating the cell is required
OR(A2="Sat","Sun") is wrong — each comparison needs the cell: OR(A2="Sat", A2="Sun").

Frequently asked questions

Why do I have to repeat the cell in OR?

Each argument is a separate test, so =OR(A2="Sat", "Sun") doesn't work. Write =OR(A2="Sat", A2="Sun"), or use a list: =OR(A2={"Sat","Sun"}).

How do I count rows that meet one condition or another?

Add two COUNTIFS, one for each option. If both can be true in the same row, use SUMPRODUCT with + and >0 so the row isn't counted twice.

What's the difference between OR and XOR?

OR is TRUE when at least one condition is true. XOR is TRUE only when an odd number of them are true, so with two conditions, exactly one.

Can I use OR in conditional formatting?

Yes. Choose Use a formula to determine which cells to format and enter something like =OR($C2>30, $D2="Disputed"). The $ keeps the columns fixed for every row.

Available in: All versions of Excel, Excel for the web, Google Sheets

Related functions

ANDNOTIFIFS