FILTER in Excel: 7 Ready-Made Use Cases (With Formulas)

FILTER in Excel: 7 Ready-Made Use Cases (With Formulas)
FILTER pulls rows out of a table when they match a condition, and it does it with a formula instead of the autofilter. The practical difference: the result sits in ordinary cells, updates when the source data changes, and can feed another formula. Below are seven cases people actually need, each with the formula to copy, plus the reasons the function sometimes refuses to work.
What FILTER returns
It takes three arguments: the range to filter, a condition that must be true for each row, and an optional value to show when nothing matches. It returns a dynamic array, so one formula fills the cell you typed it in and spills down and to the right. That spill is why you never drag it: one formula, one block of results.
Two limits are worth knowing before you start. The cells below and to the right of the formula must be empty, otherwise Excel shows #SPILL!. And the condition must refer to columns with the same number of rows as the range you are filtering, otherwise you get #VALUE!.
Case 1: one condition
Sales in A2:D500 with region in column B. To see only the North rows: =FILTER(A2:D500;B2:B500="North";"none"). The third argument is the friendliest part of the function. Without it, a month with no North sales shows #CALC!, which looks like a broken report to anyone reading it.
If you invoice clients or run a small shop, the ready-made Excel sales invoice template and bookkeeping ledger saves building the file from scratch: Excel invoice and bookkeeping template - a product in our store.
Case 2: two conditions that must both be true
Multiply the conditions: =FILTER(A2:D500;(B2:B500="North")*(D2:D500>500);"none"). The asterisk means AND. In Excel, TRUE times TRUE gives 1 and anything times FALSE gives 0, so the row survives only when every condition is 1. It reads oddly the first time and then becomes second nature.
Case 3: either condition (OR)
Add them: =FILTER(A2:D500;(B2:B500="North")+(B2:B500="South");"none"). The plus means OR, and the row survives when the result is greater than zero. Mixing both is allowed: wrap the OR part in its own parentheses so the multiplication applies to the group, not to the last comparison only.
Case 4: a date range that follows today
Invoices in A2:E500 with the due date in column D. To see what is overdue right now: =FILTER(A2:E500;(D2:D500<TODAY())*(E2:E500>0);"nothing overdue"). Because TODAY recalculates on every open, this list is never stale. The second condition matters: an invoice already paid should not appear even if its date has passed.
Case 5: filter and sort in one formula
Nest SORT around the result: =SORT(FILTER(A2:D500;D2:D500>500);4;-1) sorts the filtered rows by the fourth column, largest first. The numbers at the end are the sort column index inside the returned block and the direction, 1 for ascending and -1 for descending. This is the combination that replaces most manual copy, paste and sort routines.
Case 6: unique values from filtered rows
Wrap UNIQUE around it: =UNIQUE(FILTER(B2:B500;D2:D500>500)) returns the regions that have at least one sale above 500, each once. Useful for a dropdown list or a summary line, and it stays correct when new regions appear.
Case 7: filter a real table by its column names
If the source is formatted as a table, use its names instead of cell ranges: =FILTER(Sales;Sales[Region]="North";"none"). The formula then grows with the table, so next month's rows are included without editing anything. This is the version to use in any file that someone else will maintain.
Why you might see #SPILL!
Something is in the way. Either there is text or a formula below the cell, or a merged cell overlaps the area the result needs. Clear the block and the result appears. Merged cells are the usual culprit in files built by hand, and they are worth removing anyway.
Why you might see #VALUE!
The condition and the range disagree on size. Filtering A2:D500 while comparing C2:C400 mixes 499 rows with 399 and Excel cannot line them up. Keep every reference to the same row count, or point the whole formula at a table.
FILTER or autofilter?
| You need | Use | Why |
|---|---|---|
| A quick look at a subset, then manual work | Autofilter | Fast, leaves nothing behind |
| A result that refreshes and feeds other formulas | FILTER | It recalculates with the data |
| One value from another table | XLOOKUP | Returns a value, not rows |
| Totals per category | Pivot table | Groups and sums in one step |
A version note
FILTER needs Microsoft 365 or Excel 2021 and later. In older versions the name does not exist and the formula returns #NAME?. There, the autofilter is the practical route, or a combination of INDEX and AGGREGATE that returns rows one at a time instead of spilling.
Before you share the file
Anyone on an older Excel sees an error instead of the list. If the file travels, copy the filtered block and paste it as values into its own sheet, and keep the live formula in a working sheet. The report stays readable everywhere.
Read next
When the filtered list needs a friendly message instead of an error, the pattern is the same one used for lookups: see IFERROR in Excel: Catch #N/A, #DIV/0! and #VALUE! Before Anyone Sees Them.
A worked example with real numbers
Take four orders. Order 1081, North, 820, due 2026-12-01. Order 1082, South, 140, due 2026-12-02. Order 1083, North, 40, due 2026-11-28. Order 1084, North, 610, due 2026-12-05. Now apply case 2, North and above 500: 1081 and 1084 pass, 1082 fails on both counts, 1083 fails on the amount. The formula returns two rows and the result occupies two rows and four columns, so the block below must be clear.
Change 1083's amount to 900 and the block becomes three rows. Nothing was copied, nothing was dragged, and the header row above stays untouched because it is outside the range. That is the whole value of the function: the answer follows the data.
The mistakes people actually make
| Mistake | What you see | Fix |
|---|---|---|
| Dragging the formula down | Overlapping results or #SPILL! | Delete the extra copies, keep one |
| Ranges of different heights | #VALUE! | Match the row counts |
| Hard-coded criteria | Editing the formula every month | Point at a cell instead |
| No third argument | #CALC! on empty months | Add a text fallback |
How to test it in two minutes
Change one value in the source so that a row enters or leaves the filter, and watch whether the block changes size. If nothing moves, the formula points at a different range, or it was pasted somewhere as fixed values. Do this once before you send the file, and you will not be the person who shipped a list that had stopped updating.
Performance on big sheets
FILTER recalculates whenever anything it depends on changes, so pointing it at a whole column like A:A makes Excel work through a million rows on every keystroke nearby. Use a range that ends where the data ends, or a table, whose size follows the data. On a file with a hundred thousand rows, that single change is often the difference between a file that responds and one that pauses after every edit.
If the sheet already feels slow, check for several FILTER formulas that overlap, each spilling over the same columns, and for volatile functions like TODAY or OFFSET inside the condition. Each one recalculates more often than you would guess.
Official source
The full argument list and examples are on FILTER function. For sorting the result: SORT function. For unique values: UNIQUE function.
Last updated: 5 December 2026
Comments
Post a Comment