To filter data in Excel using a formula, use the FILTER function. This dynamic array function allows you to extract specific rows from a data range based on criteria you define, and it automatically updates the results whenever the source data changes. Unlike the manual Filter tool found in the Data tab, the formula method creates a separate, live list of results that does not hide rows in your original dataset.

What You'll Need

  • A version of Excel that supports dynamic arrays (Microsoft 365, Excel 2021, or Excel for the Web).
  • A structured dataset with clear headers (rows and columns of related information).
  • A blank area of your worksheet where the filtered results can "spill" without overlapping other data.

Step-by-Step

  1. Prepare Your Source Data: Ensure your data is organized in a clean table format. For example, if you have a sales list, your columns might be "Date," "Salesperson," "Region," and "Amount." Make sure there are no completely empty rows or columns within the dataset, as this can confuse the range selection.
  2. Identify Your Criteria: Decide exactly what you want to filter for. For instance, if you only want to see sales from the "North" region, your criteria is Region = "North". If you are filtering based on a value in another cell (like cell F1), your criteria will be Region = F1.
  3. Select the Destination Cell: Click on the empty cell where you want the filtered list to begin. Because the FILTER function is a dynamic array formula, you only enter the formula in one cell, and Excel will automatically fill the surrounding cells with the results.
  4. Enter the Basic Formula: Start typing =FILTER(. The function requires three main arguments: =FILTER(array, include, [if_empty]).
  5. Define the Array: While the cursor is inside the first argument, highlight the entire range of data you want to filter. For example, A2:D100. This is the source data that Excel will scan.
  6. Define the Include Argument: Enter a comma, then select the specific column you are filtering by and set the condition. Using our example, if the "Region" is in column C, you would type C2:C100="North". The formula now looks like: =FILTER(A2:D100, C2:C100="North").
  7. Add an Optional "If Empty" Message: To prevent the formula from showing a #CALC! error when no matches are found, add a third argument. Type another comma and a message in quotes, such as ,"No results found". The final formula is: =FILTER(A2:D100, C2:C100="North", "No results found").
  8. Press Enter: Once you hit Enter, Excel will instantly generate a new table containing only the rows that meet your criteria.

Common Mistakes

One of the most frequent errors is the #SPILL! error. This happens when there is already data sitting in the cells where the FILTER function needs to place its results. If you have typed a note or a random number in the path of the dynamic array, Excel cannot "spill" the data and will trigger this error. To fix it, clear all cells below and to the right of your formula cell.

Another common mistake is mismatched range sizes. The "array" (the data you want to return) and the "include" (the column you are checking) must have the exact same number of rows. If your array is A2:D100 (99 rows) but your criteria range is C2:C101 (100 rows), Excel will return a #VALUE! error because it cannot map the criteria to the data rows one-to-one.

Users also frequently forget to use quotation marks for text criteria. If you write C2:C100=North without quotes, Excel looks for a named range called "North." Since that likely doesn't exist, it returns a #NAME? error. Always wrap text strings in double quotes: "North".

Tips

Use Cell References for Flexibility: Instead of hard-coding "North" into your formula, point the formula to a cell. For example, =FILTER(A2:D100, C2:C100=F1). Now, whenever you type a different region into cell F1, the filtered list will update instantly without you having to edit the formula.

Filtering with Multiple Criteria (AND Logic): To filter by two conditions at once (e.g., Region is "North" AND Amount is greater than 500), use the multiplication symbol * between the criteria. The syntax is: =FILTER(A2:D100, (C2:C100="North") * (D2:D100>500)). The parentheses are mandatory here to tell Excel to evaluate each condition separately before multiplying them.

Filtering with Multiple Criteria (OR Logic): To filter by either one condition or another (e.g., Region is "North" OR Region is "South"), use the addition symbol +. The syntax is: =FILTER(A2:D100, (C2:C100="North") + (C2:C100="South")).

Combining with SORT: You can wrap the FILTER function inside a SORT function to organize your results automatically. For example, =SORT(FILTER(A2:D100, C2:C100="North"), 4, -1) will filter for the North region and then sort the results by the 4th column (Amount) in descending order (-1).

Troubleshooting

If your formula returns #CALC!, it usually means no records matched your criteria. Check for typos in your criteria text or trailing spaces in your source data. A cell that says "North " (with a space at the end) will not match a formula looking for "North". You can use the TRIM function on your source data to remove these invisible spaces.

If the data is not updating when you change the source, check your Calculation Options. Go to the Formulas tab, click Calculation Options, and ensure Automatic is selected. If it is set to Manual, the FILTER formula will only update when you press F9.

If you see a #VALUE! error, double-check your range coordinates. Ensure that if your data starts at row 2 and ends at row 500, both the array and the include arguments start at 2 and end at 500. Even a one-row difference will break the function.

Frequently Asked Questions

Can I use the FILTER formula in Excel 2016 or 2019?

No, the FILTER function is only available in Microsoft 365, Excel 2021, and the web version. For older versions, you must use the manual Filter tool or a complex combination of INDEX, SMALL, and ROW functions.

Does the FILTER function change my original data?

No, it is a non-destructive function. It reads the source data and displays a copy of the matching rows in a new location. The original dataset remains untouched.

How do I filter for blank cells?

To filter for cells that are empty, use the ="" syntax. For example, =FILTER(A2:D100, C2:C100="") will return all rows where column C is blank.

Can I filter data from a different worksheet?

Yes. When selecting your array and include ranges, simply click over to the other sheet and highlight the data. Excel will automatically add the sheet name to the formula (e.g., Sheet1!A2:D100).

How do I filter for partial text matches?

The FILTER function does not support wildcards like * directly. Instead, combine it with the SEARCH function. For example, =FILTER(A2:D100, ISNUMBER(SEARCH("Text", C2:C100))) will return rows where column C contains the word "Text" anywhere in the cell.