How to use FILTER function in Excel?

The FILTER function in Excel allows you to extract data that meets certain criteria. This can be particularly useful for getting specific subsets of data from a larger dataset. The basic syntax of the FILTER function is as follows:

=FILTER(array, include, [if_empty])
  • array: The range of cells that you want to filter.
  • include: A boolean array where each element represents whether the corresponding element in the array should be included in the result. This is usually a condition or a sequence of conditions.
  • [if_empty]: (Optional) What to return if no entries meet the criteria. If omitted and no match is found, the function returns a `#CALC!` error.

Example of Using the FILTER Function

Suppose you have a dataset in columns A to C where:

  • Column A contains “Name”
  • Column B contains “Age”
  • Column C contains “Department”

And you want to filter all employees from the “IT” department.

Here’s how you can use the FILTER function:

   =FILTER(A2:C10, C2:C10="IT", "No results")
  • Select the cell where you want the filtered data to appear. This could be somewhere on the same sheet or on a different sheet.
  • Enter the FILTER function. Assuming your data is in the range A1:C10, the function might look like this:
    • Here, `A2:C10` is the range of your data.
    • `C2:C10=”IT”` is the condition, which checks for the “IT” department in each row of column C.
    • `”No results”` is the message that appears if no data matches the criteria.
  • Press Enter. The filtered data will now appear in the selected cell. If there are any rows that meet the criteria, they will be displayed; otherwise, you’ll see “No results” (or whatever message you specified).

Additional Tips

  =FILTER(A2:C10, (C2:C10="IT")*(B2:B10>30), "No results")
  • Multiple Criteria: You can apply multiple criteria by using boolean logic. For example, to filter data where the Department is “IT” and Age is greater than 30, you can combine conditions like:
  • Dynamic Arrays: The FILTER function is a dynamic array function. This means if your source data changes, the result of the FILTER function will automatically update.
  • Compatibility: The FILTER function is available in Excel 365 and Excel 2019 (and newer). It is not available in older versions of Excel.

Using the FILTER function effectively can help streamline data analysis by automatically organizing the data according to specified conditions, saving time and reducing the risk of errors.

Unlock Your Potential

Excel

Basic - Advanced

Access

Access Basic - Advanced

Power BI

Power BI Basic - Advanced

Help us grow the project