Exceljet

Quick, clean, and to the point

Excel FILTER Function

Excel FILTER function
Summary 

The Excel FILTER function filters a range of data based on supplied criteria, and extracts matching records.

Purpose 
Filters range with given criteria
Return value 
Array of filtered values
Syntax 
=FILTER (array, include, [if_empty])
Arguments 
  • array - Range or array to filter.
  • include - Boolean array, supplied as criteria.
  • if_empty - [optional] Value to return when no results are returned.
Usage notes 

The Excel FILTER function "filters" a range of data based on supplied criteria. In the example show, the formula in F5 is:

=FILTER(B5:D14,D5:D14=H2,"No results")

Since the value in H2 is "red", the FILTER function extracts data from array where the Group column contains "red".

More than one criteria

The include argument can be extended with boolean logic. For example, to extract only data where the group is "red" and score is greater than 80, you can use a formula like this:

=FILTER(B5:D14,(D5:D14="red")*(C5:C14>80),"No results")
Note: This function is a new "Dynamic Array Function" in Excel. It is a beta feature available only through the Office Insiders program. Dynamic Array functions are expected to be released in 2019 to Office 365 subscribers.

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.