Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel FILTER Function: Step-by-Step Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To apply a filter in Excel using a formula, use the FILTER function: =FILTER(array, include, [if_empty]). It returns only the rows that meet your condition and spills the results into adjacent cells. For example, =FILTER(A2:C10, B2:B10="North", "No results") shows rows where column B equals North. This guide walks you through setting it up correctly, avoiding common errors, and fixing problems.

What You'll Need

  • Excel for Microsoft 365, Excel 2021, or Excel for the web (FILTER is not available in older perpetual versions like Excel 2019 or earlier).
  • A table or range of data with clear headers.
  • An empty area on the sheet where the results can spill (at least as many columns as your source data).

Step-by-Step

  1. Organize your data. Ensure your source range has a single header row and no blank rows or columns inside the data. For example, headers in A1:C1 and data from A2:C100. You can also convert the range to an Excel Table (select it and press Ctrl+T) so the formula automatically expands with new data.
  2. Choose a location for the results. Click an empty cell where you want the filtered output to start. Leave enough empty rows and columns below and to the right; otherwise Excel returns a #SPILL! error.
  3. Write the FILTER formula. Type =FILTER( and then specify three arguments separated by commas:
    • array: the data range you want to filter, including all columns you want to see (e.g., A2:C100). Do not include the header row unless you want it repeated.
    • include: a logical test that returns TRUE/FALSE for each row. For example, B2:B100="North" or C2:C100>100. You can combine conditions with multiplication (AND) or addition (OR). For AND: (B2:B100="North")*(C2:C100>100). For OR: (B2:B100="North")+(B2:B100="South").
    • [if_empty] (optional): what to display if no rows match, e.g., "No results". If omitted, Excel returns #CALC!.
    For example: =FILTER(A2:C100, (B2:B100="North")*(C2:C100>100), "No matching rows").
  4. Press Enter. The formula spills results into the cells below and to the right. The original data remains unchanged; only the filtered view appears.
  5. Adjust the formula as needed. To filter on a different column, change the column letter in the include argument. To change the output columns, adjust the array range. To add more conditions, extend the include argument with additional tests and operators.
  6. Format the results (optional). You can apply number formats, borders, or cell styles to the spilled range. If the source data changes, the spilled range updates automatically as long as the formula remains intact.

Common Mistakes

  • Forgetting the if_empty argument. If no rows match and you omit it, Excel shows #CALC!. Always include a fallback like "No results" or "".
  • Using mismatched range sizes. The array and include ranges must have the same number of rows. For example, if array is A2:C100, include must also cover rows 2 through 100 (e.g., B2:B100). Otherwise you get #VALUE!.
  • Including headers in the array. If you include the header row in the array but not in the include argument, the header may be treated as data or cause a mismatch. Either exclude headers from both or include them in both (with a corresponding TRUE in include).
  • Not leaving enough spill space. If cells below or to the right contain data, Excel returns #SPILL!. Clear the area or move the formula.
  • Using the wrong comparison operator. Remember that text criteria need quotes (e.g., "North"), and numeric criteria do not (e.g., 100). Use > for greater than, < for less than, <> for not equal.
  • Assuming FILTER works in all Excel versions. It is not available in Excel 2019 or earlier. Use AutoFilter or Advanced Filter instead.

Tips

  • Use Excel Tables (Ctrl+T) as the array argument so the formula automatically includes new rows. For example, =FILTER(Table1, Table1[Region]="North", "None").
  • Combine FILTER with SORT to order results: =SORT(FILTER(A2:C100, B2:B100="North"), 3, -1) sorts by the third column descending.
  • Use FILTER with UNIQUE to get distinct values: =UNIQUE(FILTER(B2:B100, C2:C100>100)).
  • To filter by multiple values from a list, use COUNTIF: =FILTER(A2:C100, COUNTIF(G2:G5, B2:B100)>0, "None") where G2:G5 holds the criteria list.
  • If you need to edit the formula, click any cell in the spilled range and edit the formula in the formula bar; the entire spill updates.
  • Remember that FILTER is dynamic: if the source data changes, the results update automatically. This is different from AutoFilter, which is static until you reapply it.

Troubleshooting

  • #SPILL! error: The spill range is blocked. Clear the cells below and to the right of the formula, or move the formula to an empty area.
  • #CALC! error: No rows meet the criteria and you omitted the if_empty argument. Add a third argument like "No results".
  • #VALUE! error: The array and include ranges have different sizes. Ensure both cover the same number of rows.
  • Formula returns all rows or none: Check your criteria. For text, ensure quotes are used and spelling matches exactly (FILTER is case-insensitive for text comparisons). For numbers, ensure no quotes around numbers. Use =FILTER(A2:C100, B2:B100="North") not =FILTER(A2:C100, B2:B100=North).
  • FILTER not recognized: Your Excel version may not support it. Check if you have Microsoft 365 or Excel 2021. If not, use Data > Filter (AutoFilter) or Advanced Filter instead.
  • Results don't update: Ensure calculation is set to Automatic (Formulas > Calculation Options > Automatic). Also, if you copied the formula as values, it won't update; re-enter the formula.

Frequently Asked Questions

Can I use FILTER with multiple criteria?

Yes. Combine conditions with multiplication for AND (e.g., (B2:B100="North")*(C2:C100>100)) or addition for OR (e.g., (B2:B100="North")+(B2:B100="South")).

Does FILTER work in Excel 2019?

No. FILTER is available only in Excel for Microsoft 365, Excel 2021, and Excel for the web. In older versions, use AutoFilter or Advanced Filter.

How do I filter by a list of values?

Use COUNTIF with the list range: =FILTER(A2:C100, COUNTIF(G2:G5, B2:B100)>0, "None") where G2:G5 contains the values to match.

Can I sort the filtered results?

Yes. Wrap FILTER in SORT: =SORT(FILTER(A2:C100, B2:B100="North"), 1, 1) sorts by the first column ascending.

Why do I get a #SPILL! error?

The spill range is blocked by existing data. Clear the cells below and to the right of the formula, or move the formula to an empty area.

Can I use FILTER on a different sheet?

Yes. Reference the sheet name in the array and include arguments, e.g., =FILTER(Sheet1!A2:C100, Sheet1!B2:B100="North", "None").