formulastreak

Logic and errors function

OR function in Google Sheets and Excel

In Google Sheets and Excel, the OR function checks several conditions and returns TRUE when at least one of them is TRUE.

Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet

Syntax

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

Arguments in [brackets] are optional. Google Sheets writes it OR(logical_expression1, [logical_expression2, ...]).

Example

=OR(H2="Pending",H2="Returned") reads: Is H2 (the order's status) "Pending", or is it "Returned"? TRUE if either one is.

Leaf & Loam orders · edit I2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultI2 = FALSE
ABCDEFGHI
1OrderDateCustomerProductCategoryQtyPriceStatusNeeds attention?
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00ShippedFALSE
310022 Mar 2026Jonas LindTerracotta potPots3$12.50ShippedFALSE
410033 Mar 2026Priya RamanSnake plantPlants2$22.00ShippedFALSE
510044 Mar 2026Tomás RuizWatering canTools1$18.00PendingTRUE
610055 Mar 2026Elif DemirFernPlants4$9.50ShippedFALSE
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25ReturnedTRUE
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00ShippedFALSE
910087 Mar 2026Ines VargaCeramic potPots2$19.00PendingTRUE
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00ShippedFALSE
1110109 Mar 2026Sofia RossiFernPlants6$9.50ShippedFALSE
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25ShippedFALSE
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00PendingTRUE

I5 shows TRUE: order 1004 is Pending. I2 and the other shipped orders show FALSE.

How the spreadsheet calculates it

Is TRUE when at least one of these is true: H2 is equal to "Pending"; H2 is equal to "Returned".

  1. 1. OR: Is TRUE when at least one of these is true: H2 is equal to "Pending"; H2 is equal to "Returned".
    • condition1 = `H2="Pending"`: the first comparison
    • condition2 = `H2="Returned"`: the next one; OR is TRUE if any is TRUE

More OR examples

  • =IF(OR(H2="Pending",H2="Returned"),"Follow up","")Flags orders that aren't simply shipped.
  • =OR(C2>15000,D2>15000,E2>15000)TRUE if any month of the quarter passed 15,000.
  • =OR(F2>=5,G2>=30)A large order: five or more items, or a price of 30 or more.
  • =NOT(OR(H2="Pending",H2="Returned"))TRUE when the status is neither Pending nor Returned.

Paste any of these into the formula explainer to see it step by step.

Tips

  • Repeat the cell in every comparison: H2="Pending",H2="Returned".
  • When the list of values grows, move it into cells and use COUNTIF instead of a long OR.
  • Wrap OR in NOT for "none of these": NOT(OR(…)).

What OR is used for

Flagging rows that need attention (pending or returned orders, overdue or missing values), accepting several valid answers, and conditional formatting or filter rules where any one condition is enough.

Arguments

ArgumentRequiredWhat it is
logical1YesThe first condition, such as H2="Pending".
logical2, ...NoUp to 255 conditions in all. OR is FALSE only when every one is FALSE.

Common mistakes

  • Writing H2="Pending" OR "Returned": each comparison needs its own H2=.

  • Using OR with not-equal tests: OR(H2<>"Pending",H2<>"Returned") is always TRUE, because every status differs from at least one of them. For "neither", use AND (or NOT around OR).

  • Expecting OR to say which condition matched: it only returns TRUE or FALSE. Use IFS or nested IFs to return a different result per condition.

In Google Sheets

Google Sheets' OR works the same way; Google calls the arguments logical_expression1, logical_expression2…

Errors you may see with OR

  • #VALUE!: None of the arguments is a condition or a number, such as OR given a range of text only.
  • #NAME?: Text compared without quotes, like `H2=Pending`.

Questions

How do I check if a cell is one of many values?

For two or three values, list each comparison inside OR. For a longer list, keep the values in a range and count matches: COUNTIF($K$2:$K$6,H2)>0 is TRUE when H2 is anywhere in K2:K6.

How do I use OR inside IF?

Make OR the condition: =IF(OR(H2="Pending",H2="Returned"),"Follow up","") flags the orders that need attention. See IF with AND and OR.

How do I combine AND and OR?

Nest them: =AND(B2="East",OR(C2>12000,D2>12000)) is TRUE for East reps who passed 12,000 in July or in August.

What's the difference between OR and XOR?

OR is TRUE when one or more conditions are TRUE. XOR with two conditions is TRUE only when exactly one of them is.

Sources

Official documentation the facts on this page were checked against.

Practise OR on a live sheet

Lesson 12, AND and OR (Unit 3, Decisions), has 4 graded exercises, checked instantly, with steps and hints when you're stuck. Pro