# How to use QUERY with multiple conditions in Google Sheets

Join tests with and and or, and bracket the or part: `=QUERY(A1:F13,"select B, C, D, F where (C = 'East' or C = 'North') and F >= 1500",1)`.

**Google Sheets:** `=QUERY(A1:F13,"select B, C, D, F where (C = 'East' or C = 'North') and F >= 1500",1)`

**Excel:** Excel has no QUERY function. Use FILTER, adding tests for OR and multiplying for AND: `=FILTER(A2:F13,((C2:C13="East")+(C2:C13="North"))*(F2:F13>=1500))`.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F |
| --- | --- | --- | --- | --- | --- |
| Date | Rep | Region | Product | Units | Revenue |
| 2026-07-03 | Ana Ruiz | East | Widget | 40 | 2080 |
| 2026-07-06 | Raj Patel | West | Gadget | 25 | 2225 |
| 2026-07-10 | Lee Chen | East | Gizmo | 12 | 1740 |
| 2026-07-14 | Ana Ruiz | North | Gadget | 30 | 2670 |
| 2026-07-17 | Kim Ortiz | West | Widget | 55 | 2860 |
| 2026-07-21 | Raj Patel | East | Widget Pro | 18 | 1422 |
| 2026-07-24 | Lee Chen | South | Gadget | 22 | 1958 |
| 2026-07-29 | Kim Ortiz | East | Gizmo | 9 | 1305 |
| 2026-08-04 | Mo Diaz | North | Gizmo | 14 | 2030 |
| 2026-08-07 | Raj Patel | South | Widget | 20 | 1040 |
| 2026-08-12 | Kim Ortiz | North | Gadget | 16 | 1424 |
| 2026-08-18 | Mo Diaz | East | Gizmo Mini | 28 | 1092 |

Formula in H1: `=QUERY(A1:F13,"select B, C, D, F where (C = 'East' or C = 'North') and F >= 1500",1)`

Result (spills 5 × 4): Rep, Region, Product, Revenue; Ana Ruiz, East, Widget, $2,080; Lee Chen, East, Gizmo, $1,740; Ana Ruiz, North, Gadget, $2,670; Mo Diaz, North, Gizmo, $2,030

## How it works

`and` needs both tests to pass and `or` needs either. Like most languages, QUERY does and before or, so the brackets are what make this "East or North, and at least 1,500" rather than "East, or North with at least 1,500".

## Other ways

- `=QUERY(A1:F13,"select B, C, D, F where C = 'East' or C = 'North' and F >= 1500",1)`: Without brackets, the revenue test only applies to North. (Includes every East order, even those under 1,500.)
- `=QUERY(A1:F13,"select B, C, D, F where C matches 'East|North' and F >= 1500",1)`: matches with | is a shorter way to say "either value".

## Common mistakes

- Mixing and with or without brackets gives a different result than you meant, with no error to warn you.
- Each test needs its own column name: `where C = 'East' or 'North'` isn't valid.

## Questions

**How do I exclude a value?**

Use != or not: `where C != 'West'` or `where not C = 'West'`.

**How do I test values typed in cells?**

Join each one in: `"where C = '"&I1&"' and F >= "&I2`.

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/query-with-multiple-conditions
