Practice free

OR function

OR checks whether at least one of several conditions holds and returns TRUE if any of them does. It is usually used inside IF to test several possibilities at once.

Example

Read it as a sentence: check whether B2 or FALSE is true, which gives FALSE.

Practice this in the app

Syntax

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

Arguments in [square brackets] are optional.

logical1 (required)
First condition.
logical2 (optional)
More conditions, up to 255.

Returns: TRUE if any condition is TRUE.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=OR(FALSE,TRUE) TRUE One true
=OR(FALSE,FALSE) FALSE None true
=OR(0,0) FALSE Numbers
=OR({0,1}) TRUE Array constant
=OR(Items!B2,FALSE) FALSE Text in reference plus FALSE
=OR(Items!D2:D7>15) TRUE Array condition
=OR("a") #VALUE! Text literal
=OR(Items!B2:B7) #VALUE! Range of text

The Items sheet these formulas read

Watch out for

  • Text and blanks in references are ignored.
  • All arguments are evaluated even if the first is TRUE.
  • Use + between conditions for row-by-row array logic.

Where it works

Excel
OR is in every version of Excel from 2007 on.
Google Sheets
Same name, same behaviour for everyday use.

Part of Logical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .