Excel FILTER function: extract matching rows automatically
Use the Excel FILTER function to pull rows that meet one or several conditions with a formula: if_empty, #SPILL! and #CALC! errors, and live reports.
A regular filter (Данные → Фильтр) only hides rows: the table stays where it is, and to move the result to another sheet you copy it by hand every time. FILTER returns the matching rows to a new place with a formula — and when the source changes, the result updates itself.
In real work this is a “live report”: a manager types a branch name into one cell and below it appear that branch’s managers and their sales. Type another branch and the list switches instantly. No macros, no manual copying.
FILTER is a dynamic array function: you enter it in one cell and the result “spills” into neighbouring cells. It is available only in Excel 2021 and Microsoft 365.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Manager | Sales | Branch | Branch: | Tashkent1 | ||
| 2 | Aziz | 8 500 000 | Tashkent | Manager | Sales | ||
| 3 | Dilnoza | 9 100 000 | Samarkand | Aziz2 | 8 500 000 | ||
| 4 | Javohir | 12 300 000 | Tashkent | Javohir | 12 300 000 | ||
| 5 | Madina | 4 200 000 | Samarkand | Sardor | 6 400 000 | ||
| 6 | Sardor | 6 400 000 | Tashkent | ||||
| 7 | Nodira | 7 800 000 | Bukhara | ||||
| 8 |
Syntax
=ФИЛЬТР(array; include; [if_empty])
- array — the range that goes into the result. Leave the header out:
A2:B7. - include — the condition: a TRUE/FALSE array with the same number of rows as array, such as
C2:C7=F1orB2:B7>=5000000. - if_empty — what to show when nothing matches:
"Not found". Without it you get #CALC!.
Several conditions:
- AND — wrap each condition in brackets and multiply:
(C2:C7="Tashkent")*(B2:B7>=8000000). - OR — add them:
(C2:C7="Samarkand")+(C2:C7="Bukhara").
TRUE×TRUE = 1, every other combination gives 0. FILTER keeps the rows with 1 (or any non-zero number).
A live report by branch
1
Set up a cell for the condition: “Branch:” in E1 and “Tashkent” in F1. Type the headers above the result (E2:F2) yourself — FILTER doesn’t return headers.
2
Select E3 and click Формулы → Ссылки и массивы → FILTER.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Manager | Sales | Branch | Branch: | Tashkent | ||
| 2 | Aziz | 8 500 000 | Tashkent | Manager | Sales | ||
| 3 | Dilnoza | 9 100 000 | Samarkand | ||||
| 4 | Javohir | 12 300 000 | Tashkent | ||||
| 5 |
3
Array — A2:B7, Include — C2:C7=F1, If_empty — "Not found". Click OK, or type the formula yourself: =ФИЛЬТР(A2:B7;C2:C7=F1;"Not found").
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Manager | Sales | Branch | Branch: | Tashkent | ||
| 2 | Aziz | 8 500 000 | Tashkent | Manager | Sales | ||
| 3 | Dilnoza | 9 100 000 | Samarkand | ||||
| 4 | Javohir | 12 300 000 | Tashkent | ||||
| 5 |
4
The result spills into E3:F5 (Excel marks it with a blue border). Now change F1 to “Samarkand” — the list updates instantly.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Manager | Sales | Branch | Branch: | Samarkand | ||
| 2 | Aziz | 8 500 000 | Tashkent | Manager | Sales | ||
| 3 | Dilnoza | 9 100 000 | Samarkand | Dilnoza | 9 100 000 | ||
| 4 | Javohir | 12 300 000 | Tashkent | Madina | 4 200 000 | ||
| 5 | Madina | 4 200 000 | Samarkand | ||||
| 6 | Sardor | 6 400 000 | Tashkent | ||||
| 7 | Nodira | 7 800 000 | Bukhara | ||||
| 8 |
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Selected | Order | Price | ||
| 2 | Bread | 4 000 | ИСТИНА | Bread | 4 000 | ||
| 3 | Milk | 12 000 | ЛОЖЬ | Rice | 18 500 | ||
| 4 | Rice | 18 500 | ИСТИНА | Tea | 35 000 | ||
| 5 | Tea | 35 000 | ИСТИНА | Oil | 28 000 | ||
| 6 | Sugar | 14 000 | ЛОЖЬ | ||||
| 7 | Oil | 28 000 | ИСТИНА | ||||
| 8 |
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Manager | Sales | Branch | Manager | Sales | ||
| 2 | Aziz | 8 500 000 | Tashkent | Aziz | 8 500 000 | ||
| 3 | Dilnoza | 9 100 000 | Samarkand | Javohir | 12 300 000 | ||
| 4 | Javohir | 12 300 000 | Tashkent | ||||
| 5 | Madina | 4 200 000 | Samarkand | ||||
| 6 | Sardor | 6 400 000 | Tashkent | ||||
| 7 | Nodira | 7 800 000 | Bukhara | ||||
| 8 |
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Selected | Most expensive | Price | ||
| 2 | Bread | 4 000 | ИСТИНА | Tea | 35 000 | ||
| 3 | Milk | 12 000 | ЛОЖЬ | Oil | 28 000 | ||
| 4 | Rice | 18 500 | ИСТИНА | Rice | 18 500 | ||
| 5 | Tea | 35 000 | ИСТИНА | Bread | 4 000 | ||
| 6 | Sugar | 14 000 | ЛОЖЬ | ||||
| 7 | Oil | 28 000 | ИСТИНА | ||||
| 8 |
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Selected | Order | Price | ||
| 2 | Bread | 4 000 | ИСТИНА | #SPILL! | |||
| 3 | Milk | 12 000 | ЛОЖЬ | ||||
| 4 | Rice | 18 500 | ИСТИНА | old1 | |||
| 5 | Tea | 35 000 | ИСТИНА | ||||
| 6 | Sugar | 14 000 | ЛОЖЬ | ||||
| 7 | Oil | 28 000 | ИСТИНА | ||||
| 8 |
Pro level: a search box, calculations on the result, picking columns
- “Contains” search.
=ФИЛЬТР(A2:C100;ЕЧИСЛО(ПОИСК(F1;A2:A100));"Not found")— type “aziz” in F1 and every name containing that fragment appears. A simple search box right on the sheet. - Calculate on the result.
=СУММ(ФИЛЬТР(B2:B7;C2:C7=F1)),=СЧЁТЗ(ФИЛЬТР(...))— like SUMIF, but with conditions of any complexity. - Refer to the whole spill. If the result starts in E3, refer to it as
E3#:=СУММ(F3#)keeps working when the number of rows changes. - Only the columns you need. In Microsoft 365:
=CHOOSECOLS(ФИЛЬТР(A2:E100;C2:C100=F1);1;4)returns columns 1 and 4. - Date ranges.
=ФИЛЬТР(A2:C100;(B2:B100>=F1)*(B2:B100<=F2))— orders between two dates. - Turn the source into an Excel Table (Ctrl + T) and use references like
Sales[Branch]— new rows are picked up automatically.
Try it in the simulator
Column C marks (TRUE) the products a customer picked. Type =ФИЛЬТР(A2:B7;C2:C7) in E2. Then type the order total =СУММ(ФИЛЬТР(B2:B7;C2:C7)) in B8. Finally change C3 to TRUE and watch the list and the total update.
| 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 | Product | Price | Selected | Order | Price | |||||||||||||||||||
| 2 | Bread | 4000 | ИСТИНА | |||||||||||||||||||||
| 3 | Milk | 12000 | ЛОЖЬ | |||||||||||||||||||||
| 4 | Rice | 18500 | ИСТИНА | |||||||||||||||||||||
| 5 | Tea | 35000 | ИСТИНА | |||||||||||||||||||||
| 6 | Sugar | 14000 | ЛОЖЬ | |||||||||||||||||||||
| 7 | Oil | 28000 | ИСТИНА | |||||||||||||||||||||
| 8 | Total: | |||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||
| 12 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.