ShareYourGroupShareYourGroupExcel Formulas

Dynamic arrays functions

FILTER function in Excel

FILTER returns the rows of a range that meet a condition, as a list that updates by itself.

FILTER does with a formula what the filter buttons do by hand, with one great difference: the result appears in other cells and updates by itself when the data changes. It is one of the dynamic array functions, available in Excel 2021 and Microsoft 365. Earlier versions do not have it.

Syntax

=FILTER(array, include, [if_empty])
ArgumentWhat it is
arrayThe range to take rows from.
includeA condition on a range with the same number of rows, such as C2:C13="North".
if_emptyWhat to show when no row passes. Without it you get the error #CALC!.

Examples

Each result below is what Excel itself showed for the formula on the sample sheet.

Sample sheet: Twelve sales made by four salespeople in three regions.
ABCDEF
1DateSalespersonRegionProductUnitsAmount
205-Jan-2026AshaNorthNotebook201200
312-Jan-2026RaviSouthPen50500
420-Jan-2026MeenaNorthBag43000
502-Feb-2026AshaEastPen30300
614-Feb-2026KabirSouthNotebook15900
728-Feb-2026RaviNorthBag21500
803-Mar-2026MeenaEastNotebook402400
915-Mar-2026AshaNorthBag32250
1022-Mar-2026KabirSouthPen60600
1101-Apr-2026RaviEastNotebook251500
1218-Apr-2026MeenaNorthPen80800
1306-May-2026AshaSouthBag53750

How it works

Give FILTER a range and a condition. It checks the condition for every row and returns the rows that pass. The formula is typed in one cell, and the answers spill into as many cells as are needed, below and to the right.

The condition must cover the same number of rows as the range. If the range is B2:F13, the condition must be on rows 2 to 13 as well, or the result is #VALUE!.

Spilling

The block of results belongs to the single formula in its top-left cell. You cannot edit the other cells of the block. If something already occupies a cell where the results need to go, the formula shows #SPILL! until you clear the way.

To refer to the whole result, however large it becomes, put a hash sign after the first cell: if the formula is in H2, H2# means "everything H2 spilled". =SUM(H2#) or =COUNTA(H2#) then stays correct as the list grows and shrinks.

More than one condition

Put each condition in its own brackets.

The words AND and OR cannot be used here, because they collapse a whole column into a single TRUE or FALSE.

Conditions can be anything that gives TRUE or FALSE for each row: comparisons with dates, ISNUMBER(SEARCH("pen",D2:D13)) for "contains", or MONTH(A2:A13)=3 for a month.

When nothing matches

With no third argument, an empty result is the error #CALC!. Always give a third argument, such as "None" or "", in any sheet that other people will read.

FILTER as a lookup that returns everything

VLOOKUP and XLOOKUP return the first match. FILTER returns all of them. "Show every order of this customer" is =FILTER(orders, customer_column=H1, "None"), with the customer's name typed in H1. Change H1 and the list changes.

Choosing columns

To return only some columns, filter a narrower range, or wrap the result in CHOOSECOLS in Microsoft 365. In Excel 2021, a second FILTER can pick columns: =FILTER(FILTER(A2:F13,C2:C13="East"),{1,0,0,1,0,1}) keeps the first, fourth and sixth.

Working with other functions

FILTER's result can feed anything.

Common mistakes

In Google Sheets

Google Sheets has FILTER too, with a different shape: =FILTER(range, condition1, condition2, ...). Extra conditions are simply listed, and there is no "if empty" argument, so IFERROR is used around it.

Related functions

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.