To put a FILTER formula in Excel, use the syntax =FILTER(array, include, [if_empty]). This function allows you to extract specific data from a range based on criteria you define, automatically creating a dynamic list that updates whenever your source data changes. Unlike the standard Filter button in the Data tab, the FILTER function is a dynamic array formula, meaning it spills the results into multiple cells automatically.
What You'll Need
- A version of Excel that supports dynamic arrays (Microsoft 365, Excel 2021, or Excel for the Web).
- A dataset organized in rows and columns (a table or a range).
- Clear criteria for what data you want to extract (e.g., "All sales over $500" or "All employees in the Marketing department").
Step-by-Step
- Prepare Your Data: Ensure your source data is clean. Your columns should have clear headers, and there should be no completely empty rows or columns within the dataset you intend to filter. While not strictly required, converting your data into an official Excel Table (Insert > Table) makes your FILTER formula dynamic, meaning if you add new rows to the table, the filter results will update automatically without you having to rewrite the range.
- Select Your Destination Cell: Click on the empty cell where you want the filtered results to begin. Make sure there is enough empty space below and to the right of this cell. Because the FILTER function "spills" the results, any existing data in the path of the results will cause a #SPILL! error.
- Start the Formula: Type
=FILTER(into the cell. This opens the function arguments. The formula requires at least two arguments: the array (the data to filter) and the include (the logic used to filter). - Define the Array: While the cursor is inside the parentheses, highlight the entire range of data you want to return. For example, if your data is in cells A2 through D100, highlight that range. If you are using a Table, you can simply click and drag to select the data body, and Excel will use a structured reference like
Table1. - Enter the Include Argument: Type a comma to move to the second argument. Now, specify the column you want to filter by and the condition it must meet. For example, if column B contains the department names and you only want "Sales", you would type
B2:B100="Sales". Ensure the range of the include argument matches the height of your array (e.g., if the array starts at row 2 and ends at 100, the include range must also be row 2 to 100). - Add the Optional [if_empty] Argument: Type another comma. This third part of the formula tells Excel what to display if no records match your criteria. If you leave this blank and no match is found, Excel returns a #CALC! error. Instead, type a text string in quotes, such as
"No results found". - Complete and Execute: Close the parentheses
)and press Enter. Excel will instantly populate the cells below and to the right with all the records that meet your criteria.
Common Mistakes
One of the most frequent errors is a mismatched range size. The array (the first argument) and the include (the second argument) must have the same number of rows. If your array is A2:D100 but your include range is B2:B50, Excel cannot map the criteria to the data and will return a #VALUE! error. Always double-check that your start and end row numbers are identical for both parts of the formula.
Another common mistake is forgetting quotation marks for text criteria. When filtering for a specific word, such as "Completed" or "North", that word must be enclosed in double quotes. If you type B2:B100=Completed without quotes, Excel looks for a named range called "Completed" rather than the text string, resulting in a #NAME? error.
Users often forget to leave room for the spill. Because the FILTER function is dynamic, it doesn't just fill one cell; it fills as many cells as necessary to show all matching results. If there is a single piece of text or a formula in the way of the output area, the entire formula will fail and show a #SPILL! error. You must clear all cells in the potential output range to resolve this.
Tips
Use Cell References for Criteria: Instead of typing "Sales" directly into the formula, point the formula to a specific cell (e.g., B2:B100=F1). Now, whatever you type into cell F1 will instantly update the filtered list. This turns your spreadsheet into an interactive dashboard without requiring any VBA or complex macros.
Filtering with Multiple Criteria (AND Logic): If you need to filter by two things at once (e.g., Department is "Sales" AND Region is "West"), use the multiplication symbol (*) between your criteria. The syntax looks like this: =FILTER(A2:D100, (B2:B100="Sales") * (C2:C100="West"), "No results"). In Excel logic, multiplication acts as the AND operator.
Filtering with Multiple Criteria (OR Logic): If you want to see results that match either one criteria or another (e.g., Department is "Sales" OR Department is "Marketing"), use the addition symbol (+). The syntax is: =FILTER(A2:D100, (B2:B100="Sales") + (B2:B100="Marketing"), "No results"). Addition acts as the OR operator.
Combine with SORT: To make your filtered list even more professional, wrap the FILTER function inside a SORT function. For example: =SORT(FILTER(A2:D100, B2:B100="Sales"), 3, 1). This will filter the data for "Sales" and then sort the results based on the third column in ascending order.
Troubleshooting
If your formula is not working as expected, start with these checks in order:
1. Check for #SPILL! Error: This is the most common issue. Look for a dashed blue border around the cell where you entered the formula. Any cell within that border that contains data must be cleared. Delete the obstructing content, and the data will appear immediately.
2. Check for #CALC! Error: This typically means that no data matches your criteria. To fix this, check your spelling in the include argument. If you are sure the spelling is correct and the data simply isn't there, ensure you have provided the [if_empty] argument so the spreadsheet displays a friendly message instead of an error code.
3. Check for #VALUE! Error: This almost always indicates a range mismatch. Ensure that your array and your include range start and end on the same row. For example, if your array is A1:C500, your include range cannot be B2:B500; it must be B1:B500.
4. Verify Version Compatibility: If you see #NAME? and you are certain the formula is typed correctly, you may be using an older version of Excel that does not support the FILTER function. Check your version via File > Account. If you are on Excel 2019 or earlier, the FILTER function is not available, and you will need to use the Advanced Filter tool or a combination of INDEX and MATCH functions.
Frequently Asked Questions
Can I filter for partial text matches?
Yes, but you cannot use the FILTER function alone. You must combine it with the ISNUMBER and SEARCH functions. For example, =FILTER(A2:D100, ISNUMBER(SEARCH("keyword", B2:B100)), "No results") will return all rows where the keyword appears anywhere within the text of column B.
Does the FILTER function update in real-time?
Yes. Because it is a dynamic array formula, any change you make to the source data (the array) or the criteria (the include argument) will cause the results to refresh instantly without needing to press a button or recalculate the sheet.
Can I filter by a date range?
Yes. You can use comparison operators like greater than (>) or less than (<). To filter for dates after January 1st, 2023, you can use B2:B100 > DATE(2023,1,1) as your include argument.
Can I select only specific columns to return?
The standard FILTER function returns all columns in the specified array. To return only specific columns, you can wrap the FILTER function inside a CHOOSECOLS function. For example, =CHOOSECOLS(FILTER(A2:D100, B2:B100="Sales"), 1, 3) will only show the first and third columns of the filtered results.
Can I use the FILTER function on data in another sheet?
Yes. Simply reference the other sheet when selecting your array and include ranges. The formula would look like =FILTER(Sheet1!A2:D100, Sheet1!B2:B100="Sales"). This is a powerful way to create a summary sheet that pulls data from a raw data tab.