Function guides · Logical

OR function

Returns TRUE if any one of the conditions is true.

Syntax

=OR(logical1, [logical2], ...)
ArgumentWhat it is
logical1A condition that evaluates to TRUE or FALSE.
logical2, ...Optional. Up to 255 more conditions.

What OR does

OR checks several conditions and returns TRUE as soon as one of them is true. Only when every condition fails does it return FALSE.

It sits in the test of an IF formula most of the time. “Flag the row if the amount is under zero or over a million” is a single OR inside an IF.

AND, its opposite number, needs everything to hold. Mixing the two up is the most frequent logic mistake in spreadsheet tests.

Each condition is a full comparison, so repeat the cell reference for every value you test against.

Because OR is short-circuit-free, it evaluates every argument. That rarely matters, but it does mean an error in the last condition spoils the whole result even when the first is TRUE. If one of the conditions can fail, guard it.

OR also combines well with AND in the same formula. “West and either over 300 or flagged” is AND(A2="West",OR(B2>300,C2="Yes")). The brackets decide the meaning, so write the sentence out and match each phrase to a function before typing. A formula with the brackets in the wrong place is the most common reason a multi-condition IF gives a plausible but wrong answer.

OR examples

1. Weekend or not

Weekend or not. The formula =OR(WEEKDAY(A2,2)=6,WEEKDAY(A2,2)=7) in cell B2 returns TRUE.
AB
1Date
23/14/2026TRUE

WEEKDAY with type 2 numbers Monday as 1 and Sunday as 7, so the weekend is 6 or 7. OR is TRUE if either holds. March 14, 2026 is a Saturday.

2. Outside an acceptable range

Outside an acceptable range. The formula =IF(OR(A2<10,A2>20),"Out of range","OK") in cell B2 returns Out of range.
AB
1Reading
225Out of range

A reading is flagged if it is below 10 or above 20. Either condition on its own is enough. A reading of 25 trips the second test.

3. Several accepted values

Several accepted values. The formula =OR(B2="Sales",B2="Support",B2="Success") in cell C2 returns TRUE.
ABC
1NameDept
2KaiSupportTRUE

A department qualifies if it is Sales, Support or Success. Three comparisons separated by commas, any one of which is enough.

Common OR mistakes

  • Using OR where AND is needed. "Between 10 and 20" is AND(A2>=10,A2<=20). An OR version is TRUE for every number.
  • Writing the comparison once. =OR(B2="Sales","Support") does not check B2 against Support. The second argument is text, not a test. Repeat the comparison.
  • Long lists of OR. More than four or five values is easier with COUNTIF against a list: =COUNTIF(F2:F4,B2)>0.
  • Not guarding against errors. If any argument is an error, OR returns that error. Wrap risky parts with IFERROR.

OR on Excel job tests

Look for "either", "any" and "at least one of": flag orders that are over $5,000 or from a new customer, mark weekend dates.

The classic slip is writing OR for a range check that needs AND. "Between 10 and 20" is AND(A2>=10,A2<=20), and an OR version is true for every number. Test with one value inside the range, one below and one above.

When the accepted values run past four or five, a lookup list is tidier: COUNTIF(list, B2)>0 replaces a long chain of comparisons.

OR questions

What is the difference between AND and OR?
AND needs every condition TRUE. OR needs at least one.
How do I use OR inside IF?
Put it in the first argument: =IF(OR(A2<10,A2>20),"Out","OK").
How many conditions can OR take?
Up to 255.
How do I check whether a value is in a list?
For long lists use COUNTIF(list,value)>0 instead of a long OR.

Practice OR

The lesson OR and NOT (module 7 of Everyday Excel) has checked OR exercises. It is part of Full Access; only the first two lessons of each module are free. The free 5-item sample test uses the same kind of formulas in a working grid if you want to try before you decide.

Try a 5-item Excel test sample