Excel FILTER Function: Extract Data Dynamically with Examples

FILTER Function in Excel Blogpost Feature Image
The Excel FILTER function replaces manual filtering entirely — one formula extracts matching rows and spills them dynamically anywhere on your sheet. This guide covers FILTER through 6 practical examples: single condition, AND/OR logic, date ranges, partial text matching, and chaining with SORT and UNIQUE. Available in Excel 365, 2024 and 2021.

The Excel FILTER function is one of the most powerful additions to Microsoft 365 — it extracts matching rows from a dataset in a single formula, with results that update automatically whenever your data or criteria change. No more Advanced Filter dialogs, no helper columns, no manual copy-paste. One formula, placed anywhere on your sheet, pulls exactly the data you need and spills it into the surrounding cells. This guide covers the syntax, the logic system behind it, and six real-world examples that go from the basics to combining FILTER with SORT, UNIQUE, and partial matching.

⚠️ Availability: FILTER requires Microsoft 365, Excel 2024, or Excel 2021. It is not available in Excel 2019 or earlier.

FILTER Function Syntax

=FILTER(array, include, [if_empty])
Argument Required? What it means
array Required The range or table to filter — the full dataset you want to extract rows from
include Required A logical condition (or combination of conditions) that returns TRUE/FALSE for each row. Rows where include is TRUE are returned.
if_empty Optional What to return when no rows match. Without this, FILTER returns a #CALC! error on no results. Use "" for blank or "No results" for a message.
How FILTER works: The include argument evaluates to an array of TRUE and FALSE values — one per row. FILTER returns every row where the result is TRUE (or any non-zero number). The results spill automatically into the cells below and to the right of the formula cell — you only type the formula once.

AND Logic vs OR Logic in FILTER

Understanding how to combine conditions is the single most important concept in FILTER. The operator you use between conditions determines whether both must be true (AND) or just one (OR):

AND logic — multiply ( * )
  • Use * between conditions
  • TRUE × TRUE = 1 → row included
  • TRUE × FALSE = 0 → row excluded
  • All conditions must be met
=FILTER(data, (A:A="North")*(B:B="Done"))
OR logic — add ( + )
  • Use + between conditions
  • TRUE + FALSE = 1 → row included
  • FALSE + FALSE = 0 → row excluded
  • At least one condition must be met
=FILTER(data, (A:A="North")+(A:A="South"))

Example 1: Single Condition Filter

The simplest use of FILTER — extract all rows where one column matches a specific value. Here you extract every order from the "North" region from a sales table.

Extract all rows where Region = "North"

Source data (A1:D6):

#
A — Order
B — Region
C — Product
D — Sales
2
ORD-001
North
Laptop
$4,200
3
ORD-002
South
Monitor
$3,100
4
ORD-003
North
Keyboard
$1,800
5
ORD-004
East
Laptop
$5,500
6
ORD-005
North
Monitor
$2,700
-- Enter this ONE formula in cell F2. -- Results spill automatically into F2:I4 (3 matching rows × 4 cols): =FILTER(A2:D6, B2:B6="North", "No results") -- Dynamic version — criteria in a cell (e.g. H1 = "North"): =FILTER(A2:D6, B2:B6=H1, "No results")
↓ Spills into 3 rows × 4 columns automatically
Rows 2, 4 and 6 (all North orders) are returned. Rows 3 and 5 are excluded. Change H1 from "North" to "South" and the output updates instantly — no formula edit needed.

Example 2: Two Conditions — AND Logic

Multiply two conditions with * to apply AND logic — only rows where both conditions are true will be returned. This is the equivalent of filtering on two columns simultaneously.

Region = "North" AND Status = "Completed"
-- Multiply conditions for AND logic: =FILTER(A2:E100, (B2:B100="North") * (C2:C100="Completed"), "No results") -- Three conditions (AND) — region, status AND amount > 1000: =FILTER(A2:E100, (B2:B100="North") * (C2:C100="Completed") * (D2:D100>1000), "No results")
Why multiplication works: Each condition produces an array of 1s (TRUE) and 0s (FALSE). Multiplying them together means a row only gets a 1 in the final array if ALL conditions were 1 — exactly AND logic. Add more conditions by multiplying more parenthesised expressions.

Example 3: OR Logic — Return Either Condition

Add conditions with + instead of multiplying them to apply OR logic — rows where any condition is true are returned. This is how you filter for multiple values in the same column.

Region = "North" OR Region = "South"
-- Add conditions for OR logic: =FILTER(A2:D100, (B2:B100="North") + (B2:B100="South"), "No results") -- Combined OR + AND: -- (North OR South) AND Status = "Completed" -- Wrap the OR part in parentheses before multiplying: =FILTER(A2:D100, ((B2:B100="North") + (B2:B100="South")) * (C2:C100="Completed"), "No results")
Operator precedence: When mixing + and * (OR and AND), always wrap each OR group in its own set of parentheses before multiplying. Otherwise Excel applies * before +, giving unexpected results — just like in standard maths.

Example 4: Filter by Number or Date Range

Use comparison operators inside the include argument to filter by numeric thresholds or date ranges. Apply two conditions to the same column — one for the lower bound, one for the upper — and multiply them together for AND logic.

Filter orders with Sales > $2,000 OR filter by date range
-- Sales greater than $2,000: =FILTER(A2:D100, D2:D100>2000, "No results") -- Sales between $1,000 and $5,000 (AND on same column): =FILTER(A2:D100, (D2:D100>=1000) * (D2:D100<=5000), "No results") -- Filter by date range (dates in column E, criteria in G1 & G2): =FILTER(A2:E100, (E2:E100>=G1) * (E2:E100<=G2), "No results")
Dates in column E must be genuine Excel serial dates (not text) for comparison operators to work. Enter your date range in cells G1 and G2 and the FILTER output updates dynamically as you change the dates.

Example 5: Partial Text Match (Contains)

FILTER does not natively support wildcards. However, nesting ISNUMBER(SEARCH(...)) inside the include argument produces a "contains" match — returning every row where the search string appears anywhere in the target column.

Find all rows where Product name contains "Lap" (partial match)
-- SEARCH finds the position of "Lap" in each cell. -- ISNUMBER converts a found position to TRUE, a #VALUE! to FALSE. -- FILTER uses that TRUE/FALSE array as its include argument: =FILTER(A2:D100, ISNUMBER(SEARCH("Lap", C2:C100)), "No results") -- Dynamic: search term in cell F1 (e.g. user types "Lap"): =FILTER(A2:D100, ISNUMBER(SEARCH(F1, C2:C100)), "No results")
SEARCH vs FIND: SEARCH is case-insensitive ("lap" matches "Laptop" and "LAP"). FIND is case-sensitive. Use SEARCH for most partial-match filters, and FIND only when case matters.
Combine partial match with AND: To find rows where Product contains "Lap" AND Region = "North", wrap both in parentheses and multiply: =FILTER(data, ISNUMBER(SEARCH("Lap",C2:C100)) * (B2:B100="North"), "")

Example 6: FILTER + SORT + UNIQUE — Chaining Dynamic Functions

FILTER becomes even more powerful when chained with other dynamic array functions. Wrap FILTER inside SORT to return filtered results in sorted order, or use UNIQUE to extract a distinct list from the filtered data — all in one formula.

Filter North orders, sorted by Sales descending
-- FILTER inside SORT — sort by column 4 (Sales), descending (-1): =SORT( FILTER(A2:D100, B2:B100="North", "No results"), 4, -1 ) -- UNIQUE on FILTER — get distinct product names from North orders: =UNIQUE( FILTER(C2:C100, B2:B100="North", "") ) -- Full pipeline: filter, sort, deduplicate — all in one formula: =SORT( UNIQUE( FILTER(C2:C100, B2:B100="North", "") ) )
The SORT argument 4, -1 means "sort by column 4 in descending order." Change -1 to 1 for ascending. All three results spill dynamically and update whenever source data changes.
Build a dynamic dropdown list: Use SORT(UNIQUE(FILTER(...))) as the source for a Data Validation list — it automatically grows or shrinks as your data changes, making dropdown menus fully self-maintaining.

Quick-Reference: FILTER Patterns

Pattern Use case Formula skeleton
=FILTER(data, col=val, "") Single condition Basic row extraction
(cond1)*(cond2) AND logic All conditions must match
(cond1)+(cond2) OR logic Any condition matches
col>=low * col<=high Numeric / date range Between two values
ISNUMBER(SEARCH(term,col)) Partial text match "Contains" filter
SORT(FILTER(...)) Filter + sort Sorted extraction
UNIQUE(FILTER(...)) Filter + deduplicate Distinct filtered values
if_empty="" Handle no results Blank instead of #CALC!

Troubleshooting FILTER Errors

#SPILL! — cells in the spill range are not empty

FILTER needs a clear block of empty cells below and to the right of the formula cell to output its results. If any cell in that range contains data (even a space), it shows #SPILL!. Clear the spill range and the error resolves. Merged cells also block spilling.

#CALC! — no rows matched and if_empty is missing

When no rows satisfy the include condition and you have not provided the third argument, FILTER returns #CALC!. Always include the if_empty argument: =FILTER(data, condition, "No results").

#VALUE! — include array has wrong dimensions

The include argument must have exactly the same number of rows as the array argument. If your data is A2:D100 (99 rows), the condition range must also be 99 rows — e.g. B2:B100.

Results do not update when new rows are added

FILTER is dynamic for data changes within the defined range, but the range itself does not auto-expand. To make it truly dynamic, convert your data to an Excel Table (Ctrl+T), then reference the table column instead: =FILTER(SalesTable, SalesTable[Region]="North", ""). Table references expand automatically.

Pro tip — wrap in IFERROR: For extra resilience, wrap FILTER in IFERROR to catch any unexpected errors gracefully: =IFERROR(FILTER(data, condition, "No results"), "Error in filter")

Frequently Asked Questions

  • The FILTER function extracts rows (or columns) from a dataset that match one or more conditions you specify. The results spill automatically into neighbouring cells and update dynamically whenever the source data or criteria change — no manual re-filtering is required.
  • FILTER is available in Microsoft 365, Excel 2024, and Excel 2021. It is not available in Excel 2019 or earlier versions. If you need similar functionality in older Excel, use the Advanced Filter feature or helper columns with COUNTIF and manual row extraction.
  • Multiply the conditions inside the include argument: =FILTER(data, (range1=crit1)*(range2=crit2), ""). Multiplication creates AND logic because TRUE×TRUE=1 (include) while TRUE×FALSE=0 (exclude). Add more conditions by multiplying more parenthesised expressions.
  • Add the conditions instead of multiplying: =FILTER(data, (range=crit1)+(range=crit2), ""). Addition creates OR logic — a row is included when at least one condition returns TRUE. When mixing AND and OR, wrap the OR group in parentheses before multiplying: ((A=1)+(A=2))*(B=3).
  • The optional third argument controls what FILTER returns when no rows match the criteria. Without it, FILTER returns a #CALC! error when there are no results. Use "" for a blank cell, "No results" for a message, or 0 for a zero value.
  • A #SPILL! error means the cells where FILTER wants to output its results are not empty. Clear the cells in the spill range below and to the right of the formula cell. Also check for merged cells — FILTER cannot spill into a merged cell range. Convert your source data to a Table to make the formula range auto-expanding.