FILTER Function
FILTER pulls out matching rows from a table based on a condition. Unlike VLOOKUP (which returns one value), FILTER can return entire rows and multiple matches — all in one formula.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| array | The range or array to filter. Can be a single column or a multi-column table. | Required |
| include | A Boolean array (TRUE/FALSE) of the same height as the array. TRUE rows are included, FALSE rows are excluded. | Required |
| if_empty | The value to return when no results match the filter. Default is #CALC!. | Optional |
Basic Example
Filter a product table to show only items in the 'Electronics' category
=FILTER(A2:D50, C2:C50="Electronics")C2:C50="Electronics" creates a TRUE/FALSE array. FILTER keeps only rows where the category is 'Electronics' and spills the matching rows.
Advanced Examples
Example 1: Multiple condition filter (AND logic)
Data analysisFilter for Electronics items priced under $100
=FILTER(A2:D50, (C2:C50="Electronics")*(B2:B50<100))Example 2: Multiple condition filter (OR logic)
Flexible searchFilter for items that are either 'Electronics' OR 'Books'
=FILTER(A2:D50, (C2:C50="Electronics")+(C2:C50="Books")>0)Example 3: FILTER with custom empty message
User-friendly outputReturn 'No results found' when the filter produces no matches
=FILTER(A2:D50, C2:C50="Furniture", "No results found")How FILTER Works
FILTER works by creating a Boolean mask over your data. The 'include' argument evaluates each row against your condition, producing an array of TRUE/FALSE values. Rows where the result is TRUE are kept; FALSE rows are dropped. The remaining rows spill into adjacent cells as a dynamic array. For multiple conditions, multiply (*) for AND logic or add (+) for OR logic — this converts TRUE/FALSE to 1/0, allowing math-based combination.
Important Notes & Limitations
FILTER is only available in Excel 365 and Excel 2021+ — not in earlier versions.
Results spill into adjacent cells — those cells must be empty or you'll get a #SPILL! error.
FILTER returns all matching rows — there's no built-in way to limit to top N results (use SORT + INDEX for that).
Large datasets may slow down recalculation since FILTER re-evaluates on every change.
Common Errors & Fixes
#CALC!No rows match the filter condition and no if_empty argument was providedFix: Add a third argument: =FILTER(range, condition, "No results") to display a custom message instead of the error.
#SPILL!Filtered results need to spill into cells that already contain dataFix: Clear the cells below and to the right of the FILTER formula to give it room to spill results.
#VALUE!The include array has a different number of rows than the data arrayFix: Ensure both arrays have the same height. If data is A2:D50 (49 rows), include must also span 49 rows.
Download Practice File
FILTER
filterPractice FILTER with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the FILTER function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps
Related Tutorials
Master Excel Dynamic Arrays (Excel 365)
Learn how to use modern dynamic array functions like FILTER, SORT, UNIQUE, and SEQUENCE to transform your spreadsheets.
Google Sheets ARRAYFORMULA
Google Sheets ARRAYFORMULA applies one formula to an entire range at once, so you never copy down again. Learn how to combine it with IF, FILTER, and QUERY.