Excel Advanced Filter: AND/OR criteria and copying results to another location
Advanced Filter: the criteria range, AND/OR logic, copying results elsewhere, unique records, formula criteria and the “Tashkent region” trap.
The regular filter (Ctrl + Shift + L) is fine for everyday work, but it has limits: you can’t set OR across columns (“Tashkent or amount over 10 mln”), you can’t send the result to a separate place, and the criteria are invisible — a colleague opening the file can’t tell what was filtered.
The Advanced Filter solves this: criteria are written on the sheet itself, in a separate criteria range. They are always visible, easy to change, and the result can be copied next to the table or elsewhere.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Manager | City | Amount, mln | |||||
| 2 | =Tashkent | >5 | ||||||
| 3 | ||||||||
| 4 | Manager | City | Amount, mln | Manager | City | Amount, mln | ||
| 5 | Aziz | Tashkent | 4,5 | Javohir | Tashkent | 6,8 | ||
| 6 | Dilnoza | Samarkand | 7,2 | Aziz | Tashkent | 8,3 | ||
| 7 | Javohir | Tashkent | 6,8 | |||||
| 8 | Malika | Tashkent region | 9,1 | |||||
| 9 | Sardor | Bukhara | 12,4 | |||||
| 10 | Nodira | Samarkand | 3,9 | |||||
| 11 | Aziz | Tashkent | 8,3 | |||||
| 12 |
Advanced Filter — 4 steps
1
Build a criteria range above the table: copy the column headers exactly (A1:C1) and write the conditions beneath them. Leave at least one blank row between the criteria and the table.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Manager | City | Amount, mln | |
| 2 | =Tashkent1 | >5 | ||
| 3 | ||||
| 4 | Manager | City | Amount, mln | |
| 5 | Aziz | Tashkent | 4,5 | |
| 6 | Dilnoza | Samarkand | 7,2 | |
| 7 | Javohir | Tashkent | 6,8 | |
| 8 | Malika | Tashkent region | 9,1 | |
| 9 |
2
Click any cell in the source table (for example A5). Then on the Данные tab, in the Sort & Filter group, choose Advanced.
3
In the dialog choose Copy to another location and check the ranges: List range — the table with its header ($A$4:$C$11), Criteria range — the criteria with their header ($A$1:$C$2), Copy to — the cell where the result starts ($E$4).
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Manager | City | Amount, mln | |
| 2 | =Tashkent | >5 | ||
| 3 | ||||
| 4 | Manager | City | Amount, mln | |
| 5 | Aziz | Tashkent | 4,5 | |
| 6 | Dilnoza | Samarkand | 7,2 | |
| 7 | Javohir | Tashkent | 6,8 | |
| 8 | Malika | Tashkent region | 9,1 | |
| 9 |
4
Click OK. Starting at E4, Excel copies the headers and the matching rows — as in the picture at the top. The source table stays untouched.
Writing criteria: AND and OR
One golden rule: conditions on the same row mean AND, conditions on different rows mean OR.
Tashkentand>5on one row — “Tashkent AND over 5”.Tashkenton row 2,Samarkandon row 3 — “Tashkent OR Samarkand”.- For a range on one column (5 to 9), write the header twice:
Amount, mln | Amount, mln, with>=5and<=9beneath.
Comparison operators: >, <, >=, <=, <> (not equal). A blank cell means “no condition on this column”.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Manager | City | Amount, mln | Amount, mln | |
| 2 | Tashkent | >=5 | <=9 | ||
| 3 | Samarkand | ||||
| 4 | |||||
| 5 |
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Manager | City | Amount, mln | |||||
| 2 | Tashkent | >5 | ||||||
| 3 | ||||||||
| 4 | Manager | City | Amount, mln | Manager | City | Amount, mln | ||
| 5 | Aziz | Tashkent | 4,5 | Javohir | Tashkent | 6,8 | ||
| 6 | Dilnoza | Samarkand | 7,2 | Malika | Tashkent region1 | 9,1 | ||
| 7 | Javohir | Tashkent | 6,8 | Aziz | Tashkent | 8,3 | ||
| 8 | Malika | Tashkent region | 9,1 | |||||
| 9 | Sardor | Bukhara | 12,4 | |||||
| 10 | Nodira | Samarkand | 3,9 | |||||
| 11 | Aziz | Tashkent | 8,3 | |||||
| 12 |
Pro level: formula criteria, unique lists and wildcards
Formula criteria. The criteria range can hold a formula too — for example, “amount above average”. Two rules:
- The header above the formula must differ from every table header (or be blank): e.g. “Above average”.
- The formula refers to the first data row with a relative reference:
=C5>СРЗНАЧ($C$5:$C$11). The cell shows TRUE/FALSE — that’s normal; Excel re-evaluates the formula for each row.
Unique records. The Unique records only box gives you a list without duplicates. For instance, set List range to column B only and run it with no criteria — a unique list of cities is ready. This works in Excel 2016 too (UNIQUE exists only in Excel 2021/365).
Wildcards: *region — ends with “region”, ? — any single character. <>Tashkent — everything except Tashkent.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Above average | |||||||
| 2 | ЛОЖЬ | |||||||
| 3 | ||||||||
| 4 | Manager | City | Amount, mln | Manager | City | Amount, mln | ||
| 5 | Aziz | Tashkent | 4,5 | Malika | Tashkent region | 9,1 | ||
| 6 | Dilnoza | Samarkand | 7,2 | Sardor | Bukhara | 12,4 | ||
| 7 | Javohir | Tashkent | 6,8 | Aziz | Tashkent | 8,3 | ||
| 8 | Malika | Tashkent region | 9,1 | |||||
| 9 | Sardor | Bukhara | 12,4 | |||||
| 10 | Nodira | Samarkand | 3,9 | |||||
| 11 | Aziz | Tashkent | 8,3 | |||||
| 12 |
Try it in the simulator
See the “starts with” logic using COUNTIF: type =СЧЁТЕСЛИ(B2:B8;"Tashkent") (exact match) in E2 and =СЧЁТЕСЛИ(B2:B8;"Tashkent*") in E3 (this is how a plain “Tashkent” behaves in the Advanced Filter). The difference is “Tashkent region”.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Manager | City | Amount, mln | Result | ||||||||||||||||||||
| 2 | Aziz | Tashkent | 4,5 | |||||||||||||||||||||
| 3 | Dilnoza | Samarkand | 7,2 | |||||||||||||||||||||
| 4 | Javohir | Tashkent | 6,8 | |||||||||||||||||||||
| 5 | Malika | Tashkent region | 9,1 | |||||||||||||||||||||
| 6 | Sardor | Bukhara | 12,4 | |||||||||||||||||||||
| 7 | Nodira | Samarkand | 3,9 | |||||||||||||||||||||
| 8 | Aziz | Tashkent | 8,3 | |||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||
| 12 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.