# How to check if a cell equals one of several values in Excel

List the matches inside OR: =IF(OR(B2="CA",B2="OR",B2="WA"),"West","Central"). For a long list, keep it in cells and use COUNTIF.

**Excel:** `=IF(OR(B2="CA",B2="OR",B2="WA"),"West","Central")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Order | State | Warehouse |  | West states |
| 1001 | CA |  |  | CA |
| 1002 | TX |  |  | OR |
| 1003 | WA |  |  | WA |
| 1004 | NY |  |  |  |
| 1005 | OR |  |  |  |
| 1006 | FL |  |  |  |
| 1007 | wa |  |  |  |

Formula in C2, filled to C8: `=IF(OR(B2="CA",B2="OR",B2="WA"),"West","Central")`

Result: West; Central; West; Central; West; Central; West

## How it works

Each `B2="…"` is its own TRUE/FALSE test, and OR returns TRUE if any of them is TRUE. IF then picks the warehouse. The comparisons ignore case, so "wa" matches too.

## Other ways

- `=IF(COUNTIF($E$2:$E$4,B2),"West","Central")`: Keeps the list on the sheet: COUNTIF returns 1 when the state is in `E2:E4`. Best when the list is long or changes.
- `=IF(OR(B2={"CA","OR","WA"}),"West","Central")`: An array constant compares against all three at once. In Google Sheets, wrap it in ARRAYFORMULA.

## Common mistakes

- `=IF(B2="CA" OR "WA",…)` is not valid, and `B2=OR("CA","WA")` returns #VALUE!. Each value needs its own comparison inside OR.
- Lock the list range with $ when you use the COUNTIF version, or it slides down as you fill.

## Questions

**How do I check that a cell is none of the values?**

Wrap the test in NOT: `=IF(NOT(OR(B2="CA",B2="OR",B2="WA")),"Central","West")`, or test `COUNTIF($E$2:$E$4,B2)=0`.

**How do I return a different result for each value?**

Use SWITCH or a lookup table: `=SWITCH(B2,"CA","Reno","WA","Tacoma","Dallas")`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/if-cell-equals-one-of-several-values
