# OR formula generator

> Describe what you need and get a OR formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested OR examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/or · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

OR returns TRUE when at least one of its conditions is TRUE.

Describe the task at [OR formula generator](https://spreadsheetpractice.com/tools/formula-generator/or) and get a OR formula for Excel and Google Sheets, tested on real data.

## Tested OR examples

### Check if a cell equals one of several values

`=IF(OR(B2="CA",B2="OR",B2="WA"),"West","Central")`

Excel. Result on the sample sheet: 7 rows (C2:C8). [See it and try it](https://spreadsheetpractice.com/formulas/if-cell-equals-one-of-several-values)

### Calculate days between dates only when both dates are filled

`=IF(OR(B2="",C2=""),"",C2-B2)`

Excel. Result on the sample sheet: 6 rows (D2:D7). [See it and try it](https://spreadsheetpractice.com/formulas/days-between-dates-only-when-both-are-filled)

### Find outliers with the IQR method

`=IF(OR(B2<$G$2,B2>$H$2),"Outlier","")`

Excel. Result on the sample sheet: 10 rows (C2:C11). [See it and try it](https://spreadsheetpractice.com/formulas/find-outliers-with-iqr)

### Use IF with AND and OR together

`=IF(AND(B2="Yes",OR(C2>=$H$1,D2="Local")),"Yes","No")`

Excel. Result on the sample sheet: 6 rows (E2:E7). [See it and try it](https://spreadsheetpractice.com/formulas/if-with-and-and-or-together)

### Find cells with leading or trailing spaces

`=OR(LEFT(A2)=" ",RIGHT(A2)=" ")`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/find-cells-with-leading-or-trailing-spaces)

### Check if a time is between two times

`=IF(MOD(B2-$F$1,1)<MOD($F$2-$F$1,1),"Yes","No")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-a-time-is-between-two-times)

### Check if neither of two conditions is true

`=IF(NOT(OR(B2="Yes",C2>=$G$1)),"Reject","Review")`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-neither-condition-is-true)

### Check if a cell contains any word from a list

`=IF(SUMPRODUCT(--ISNUMBER(SEARCH($D$2:$D$4,A2)))>0,"Yes","No")`

Excel. Result on the sample sheet: 7 rows (B2:B8). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-cell-contains-any-word-from-a-list)

## Questions

### What does the OR formula generator do?

You describe the task in plain English, and it writes the formula, using OR where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does OR do?

OR returns TRUE when at least one of its conditions is TRUE.

### Can I learn to write OR formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the OR function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
