Note: The other languages of the website are Google-translated. Back to English

Excel FILTER Function

The FILTER function filters a range of data and dynamically returns the matching results according to the criteria you specify.

Note: The FILTER function is only available in Excel for Microsoft 365, Excel 2021 or newer versions of Excel, and Excel for the web.

filter function 1


Syntax

=FILTER(array, include, [if_empty])


Arguments

  • array (required): The range or array to filter.
  • include (required): The logical test that returns an array of Boolean values (TRUE or FALSE) indicating whether the corresponding row or column in array should pass through FILTER.
  • [if_empty] (optional): The value to return if there are no matching results in the included array.

Return Value

The FILTER function returns an array.


Function Notes

  • array can be supplied as a row of values, a column of values, or a combination of rows and columns of values.
  • The dimensions of include should equal to that of the array argument.
  • To add two or more criteria in include, you should enclose each criterion in brackets and connect them with an asterisk (*).
  • The result returned by FILTER will spill into a range of cells in the way your original data of array is organized. If one or more cells in the spill range are not empty, the #SPILL! error will be returned.
  • If any of the values supplied as the include argument is an error or cannot be converted to a Boolean value, FILTER will return an error.
  • Text values in the include or if_empty arguments should be enclosed in double quotation marks. Otherwise, FILTER will return the #NAME? error.
  • To display nothing when there is no matching data, supply an empty string ("") for if_empty.
  • FILTER will return the #CALC! error if there is no matching data and the value for if_empty is not provided.
  • FILTER can be used between different workbooks. However, make sure the referenced workbooks are open. Otherwise, a #REF! error will be returned if you refresh the result cell.
  • The results of FILTER are dynamic, meaning that they update automatically when values in the source data change. However, the results will not be updated if you add new entries to array. To fix this, you should use structured references as the array argument.

Example

Supposing you have a student table as shown below, to filter the students who are from Class A and scored more than 60, please copy or enter the formula below in the top left cell of the result table and then press Enter to get the result:

=FILTER(B3:E14,(B3:B14="Class A")*(E3:E14>60),"NO RECORDS")

Or, use cell references to make the formula dynamic:

=FILTER(B3:E14,(B3:B14=H3)*(E3:E14>J3),"NO RECORDS")

filter function 2


Example of No Matches

Suppose that you want to filter the students who are from Class A and scored less than 60 (apparently there is no score that is less than 60), to display the results as nothing or a certain text string, you could copy the formulas below and press Enter to see the results.

=FILTER(B3:E14,(B3:B14="Class A")*(E3:E14<60),"") >>> Returns nothing

=FILTER(B3:E14,(B3:B14="Class A")*(E3:E14<60),"NO RECORDS") >>> Returns NO RECORDS

filter function 3


Related functions

Excel SORT Function

The SORT function sorts the contents of a range or array in ascending or descending order.

Excel SORTBY Function

The SORTBY function sorts the contents of one range or array based on the values in a corresponding range or array, no matter the corresponding range or array is included in the range or array to be sorted or not.

Excel UNIQUE Function

The UNIQUE function extracts unique values from a range of data. The data can include text, numbers, dates, error values, etc.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL