Smart Systems for Home

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

Excel FILTER Formula: Step-by-Step Guide

· 6 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

The FILTER function in Microsoft Excel returns a subset of data that meets the conditions you specify. It is available in Excel for Microsoft 365, Excel 2021, and Excel for the web. If you have an older perpetual version (Excel 2019 or earlier), FILTER is not available; use AutoFilter or an array formula with INDEX and SMALL instead. To use FILTER, your data should be in a contiguous range or an Excel Table, and you should know which column contains the values you want to test.

What You'll Need

  • Excel for Microsoft 365, Excel 2021, or Excel for the web (FILTER is not in Excel 2019 or earlier).
  • A worksheet with data in a consistent layout: one header row and no blank rows or columns inside the data range.
  • An empty area on the sheet where the filtered results can spill. Dynamic array formulas need room to expand; if cells below or to the right are occupied, you will get a #SPILL! error.

Step-by-Step

  1. Select the output cell. Click an empty cell where you want the first result to appear. Leave enough empty rows and columns below and to the right for the results to spill into. For example, if you expect up to 50 rows and 4 columns, make sure that block is empty.
  2. Start the formula. Type =FILTER( in the cell. Excel will show the argument names: array, include, [if_empty].
  3. Supply the array. Select the entire data range including headers if you want headers returned, or exclude the header row if you only want data rows. For example, A2:D100 returns data rows only; A1:D100 includes the header row as the first row of results.
  4. Build the include argument. This is a logical test that returns TRUE or FALSE for each row. For a single condition, compare a column to a value: C2:C100="North". The include argument must be the same height as the array (same number of rows). If the array is A2:D100 (99 rows), then C2:C100 also has 99 rows, so it matches.
  5. Add multiple conditions with multiplication. In FILTER, multiply conditions to mean AND, and add them to mean OR. For example, to return rows where column C is "North" and column D is greater than 100: (C2:C100="North")*(D2:D100>100). To return rows where C is "North" or "South": (C2:C100="North")+(C2:C100="South"). Wrap each condition in parentheses.
  6. Set the if_empty argument (optional but recommended). Add a third argument that displays when no rows match, such as "No results". Without it, Excel returns a #CALC! error when nothing matches. Example: =FILTER(A2:D100, C2:C100="North", "No results").
  7. Close the parenthesis and press Enter. The results spill into the cells below and to the right. The formula remains in the first cell only; the rest are spill results. If you click any spill cell, Excel outlines the whole spill range.
  8. Test and adjust. Change the criteria value in a cell and reference that cell in the formula instead of hard-coding text. For example, put "North" in cell F1 and use C2:C100=F1. This makes the filter interactive.

Common Mistakes

  • Mismatched range sizes. The include argument must have the same number of rows as the array. If the array is A2:D100 (99 rows) and the condition is C2:C50 (49 rows), Excel returns #VALUE!. Always use the same start and end rows for both.
  • Forgetting parentheses around conditions. In C2:C100="North"*D2:D100>100, Excel evaluates the comparison before multiplication, which gives wrong results. Write (C2:C100="North")*(D2:D100>100).
  • Blocked spill range. If any cell in the spill area contains data, you get #SPILL!. Clear the cells or move the formula to an empty area. Merged cells also block spilling.
  • Using whole-column references unnecessarily. FILTER(A:A, C:C="North") works but can be slow on large workbooks and may include the header row in the test. Prefer bounded ranges or Excel Tables.
  • Expecting FILTER to work in Excel 2019 or earlier. It will return #NAME?. Use AutoFilter or an INDEX/SMALL array formula instead, or open the file in Microsoft 365.

Tips

  • Convert your data to an Excel Table (select the range and press Ctrl+T). Then you can use structured references like Table1[Region], and the formula adjusts automatically when rows are added.
  • Combine FILTER with SORT to order results: =SORT(FILTER(A2:D100, C2:C100="North"), 2, -1) sorts by the second column descending.
  • Use FILTER with a cell reference for the criteria so users can change the filter without editing the formula.
  • If you need to return only specific columns, wrap FILTER around a CHOOSECOLS or use INDEX inside FILTER, for example =FILTER(CHOOSECOLS(A2:D100,1,3), C2:C100="North").
  • Remember that FILTER returns a dynamic array. If you copy the formula down, you will get #SPILL! because each copy tries to spill into the same area. Enter it once.

Troubleshooting

If you see #SPILL!, the output area is not empty. Select the cells in the spill range (Excel highlights them with a dashed border) and clear them, or move the formula. Check for merged cells, which also cause this error.

If you see #CALC!, no rows met your criteria and you did not supply an if_empty argument. Add a third argument such as "None".

If you see #VALUE!, the include argument's row count does not match the array's row count. Verify both ranges start and end on the same rows.

If you see #NAME?, your Excel version does not support FILTER, or the function name is misspelled. Check that you are on Microsoft 365, Excel 2021, or Excel for the web.

If results look wrong, check for text vs. numbers: "100" (text) does not equal 100 (number). Also check for leading or trailing spaces in text values; use TRIM or clean the data.

If the formula returns only the first row, you may have entered it as a legacy array formula (Ctrl+Shift+Enter) in an older version. In dynamic array Excel, a normal Enter is enough. If you are in an older version, FILTER is not available.

Frequently Asked Questions

Can I use FILTER with multiple criteria?

Yes. Multiply conditions for AND, add them for OR. Wrap each condition in parentheses, for example (C2:C100="North")*(D2:D100>100).

Does FILTER work in Excel 2019?

No. FILTER is available only in Excel for Microsoft 365, Excel 2021, and Excel for the web. In Excel 2019 and earlier, use AutoFilter or an array formula with INDEX and SMALL.

Why do I get #SPILL!?

The cells where the results would appear are not empty. Clear the spill range or move the formula to an empty area. Merged cells also block spilling.

Can FILTER return only certain columns?

Yes. Use CHOOSECOLS inside FILTER, for example =FILTER(CHOOSECOLS(A2:D100,1,3), C2:C100="North") returns columns A and C only.

How do I sort filtered results?

Wrap FILTER in SORT: =SORT(FILTER(A2:D100, C2:C100="North"), 2, -1) sorts by the second column in descending order.

Can I use FILTER with a cell reference for the criteria?

Yes. Put the criteria value in a cell, such as F1, and use C2:C100=F1. Changing F1 updates the results automatically.