How to do filtering in excel

Use AutoFilter or built-in comparison operators like «greater than» and “top 10” in Excel to show the data you want and hide the rest. Once you filter data in a range of cells or table, you can either reapply a filter to get up-to-date results, or clear a filter to redisplay all of the data.

Use filters to temporarily hide some of the data in a table, so you can focus on the data you want to see.

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Filter a range of data

  1. Select any cell within the range.

  2. Select Data > Filter.

    Filter button

  3. Select the column header arrow Filter arrow.

  4. Select Text Filters or Number Filters, and then select a comparison, like Between.

    Number Filters Between

  5. Enter the filter criteria and select OK.

    Custom AutoFilter dialog box

Filter data in a table

When you put your data in a table, filter controls are automatically added to the table headers.

An Excel table showing built-in filters

  1. Select the column header arrow Filter drop-down arrow for the column you want to filter.

  2. Uncheck (Select All)  and select the boxes you want to show.

    Filter Gallery

  3. Click OK.

    The column header arrow Filter drop-down arrow changes to a Applied filter iconFilter  icon. Select this icon to change or clear the filter.

Related Topics

Excel Training: Filter data in a table

Guidelines and examples for sorting and filtering data by color

Filter data in a PivotTable

Filter by using advanced criteria

Remove a filter

Filtered data displays only the rows that meet criteria that you specify and hides rows that you do not want displayed. After you filter data, you can copy, find, edit, format, chart, and print the subset of filtered data without rearranging or moving it.

You can also filter by more than one column. Filters are additive, which means that each additional filter is based on the current filter and further reduces the subset of data.

Note: When you use the Find dialog box to search filtered data, only the data that is displayed is searched; data that is not displayed is not searched. To search all the data, clear all filters.

The two types of filters

Using AutoFilter, you can create two types of filters: by a list value or by criteria. Each of these filter types is mutually exclusive for each range of cells or column table. For example, you can filter by a list of numbers, or a criteria, but not by both; you can filter by icon or by a custom filter, but not by both.

Reapplying a filter

To determine if a filter is applied, note the icon in the column heading:

  • A drop-down arrow Filter drop-down arrow means that filtering is enabled but not applied.

    When you hover over the heading of a column with filtering enabled but not applied, a screen tip displays «(Showing All)».

  • A Filter button Applied filter icon means that a filter is applied.

    When you hover over the heading of a filtered column, a screen tip displays the filter applied to that column, such as «Equals a red cell color» or «Larger than 150».

When you reapply a filter, different results appear for the following reasons:

  • Data has been added, modified, or deleted to the range of cells or table column.

  • Values returned by a formula have changed and the worksheet has been recalculated.

Do not mix data types

For best results, do not mix data types, such as text and number, or number and date in the same column, because only one type of filter command is available for each column. If there is a mix of data types, the command that is displayed is the data type that occurs the most. For example, if the column contains three values stored as number and four as text, the Text Filters command is displayed .

Filter data in a table

When you put your data in a table, filtering controls are added to the table headers automatically.

  1. Select the data you want to filter. On the Home tab, click Format as Table, and then pick Format as Table.

    Button to format data as a table

  2. In the Create Table dialog box, you can choose whether your table has headers.

    • Select My table has headers to turn the top row of your data into table headers. The data in this row won’t be filtered.

    • Don’t select the check box if you want Excel for the web to add placeholder headers (that you can rename) above your table data.

      Dialog box for converting data range into a table

  3. Click OK.

  4. To apply a filter, click the arrow in the column header, and pick a filter option.

Filter a range of data

If you don’t want to format your data as a table, you can also apply filters to a range of data.

  1. Select the data you want to filter. For best results, the columns should have headings.

  2. On the Data tab, choose Filter.

Filtering options for tables or ranges

You can either apply a general Filter option or a custom filter specific to the data type. For example, when filtering numbers, you’ll see Number Filters, for dates you’ll see Date Filters, and for text you’ll see Text Filters. The general filter option lets you select the data you want to see from a list of existing data like this:

Custom number filter option

Number Filters lets you apply a custom filter:


the custom filtering options available for number values.

In this example, if you want to see the regions that had sales below $6,000 in March, you can apply a custom filter:

apply the custm filter for number values

Here’s how:

  1. Click the filter arrow next to March > Number Filters > Less Than and enter 6000.

    applying a custom filter to show values below a certain criteria

  2. Click OK.

    Excel for the web applies the filter and shows only the regions with sales below $6000.

    Results of applying a custom number filter

You can apply custom Date Filters and Text Filters in a similar manner.

To clear a filter from a column

  • Click the Filter Applied filter icon button next to the column heading, and then click Clear Filter from <«Column Name»>.

To remove all the filters from a table or range

  • Select any cell inside your table or range and, on the Data tab, click the Filter button.

    This will remove the filters from all the columns in your table or range and show all your data.

  1. Click a cell in the range or table that you want to filter.

  2. On the Data tab, click Filter.

    On the Data tab, select Filter

  3. Click the arrow Arrow showing that column is filtered in the column that contains the content that you want to filter.

  4. Under Filter, click Choose One, and then enter your filter criteria.

    In the Filter box, select Choose One

Notes: 

  • You can apply filters to only one range of cells on a sheet at a time.

  • When you apply a filter to a column, the only filters available for other columns are the values visible in the currently filtered range.

  • Only the first 10,000 unique entries in a list appear in the filter window.

  1. Click a cell in the range or table that you want to filter.

  2. On the Data tab, click Filter.

    On the Data tab, select Filter

  3. Click the arrow Arrow showing that column is filtered in the column that contains the content that you want to filter.

  4. Under Filter, click Choose One, and then enter your filter criteria.

    In the Filter box, select Choose One

  5. In the box next to the pop-up menu, enter the number that you want to use.

  6. Depending on your choice, you may be offered additional criteria to select:

    In the Filter box, select And or Or to add more criteria

Notes: 

  • You can apply filters to only one range of cells on a sheet at a time.

  • When you apply a filter to a column, the only filters available for other columns are the values visible in the currently filtered range.

  • Only the first 10,000 unique entries in a list appear in the filter window.

  • Instead of filtering, you can use conditional formatting to make the top or bottom numbers stand out clearly in your data.

You can quickly filter data based on visual criteria, such as font color, cell color, or icon sets. And you can filter whether you have formatted cells, applied cell styles, or used conditional formatting.

  1. In a range of cells or a table column, click a cell that contains the cell color, font color, or icon that you want to filter by.

  2. On the Data tab, click Filter .

    On the Data tab, select Filter

  3. Click the arrow AutoFilter arrow in the column that contains the content that you want to filter.

  4. Under Filter, in the By color pop-up menu, select Cell Color, Font Color, or Cell Icon, and then click a color.

This option is available only if the column that you want to filter contains a blank cell.

  1. Click a cell in the range or table that you want to filter.

  2. On the Data toolbar, click Filter.

    On the Data tab, select Filter

  3. Click the arrow AutoFilter arrow in the column that contains the content that you want to filter.

  4. In the (Select All) area, scroll down and select the (Blanks) check box.

    Notes: 

    • You can apply filters to only one range of cells on a sheet at a time.

    • When you apply a filter to a column, the only filters available for other columns are the values visible in the currently filtered range.

    • Only the first 10,000 unique entries in a list appear in the filter window.

  1. Click a cell in the range or table that you want to filter.

  2. On the Data tab, click Filter .

    On the Data tab, select Filter

  3. Click the arrow AutoFilter arrow in the column that contains the content that you want to filter.

  4. Under Filter, click Choose One, and then in the pop-up menu, do one of the following:

    To filter the range for

    Click

    Rows that contain specific text

    Contains or Equals.

    Rows that do not contain specific text

    Does Not Contain or Does Not Equal.

  5. In the box next to the pop-up menu, enter the text that you want to use.

  6. Depending on your choice, you may be offered additional criteria to select:

    In the Filter box, select And or Or to add more criteria

    To

    Click

    Filter the table column or selection so that both criteria must be true

    And.

    Filter the table column or selection so that either or both criteria can be true

    Or.

  1. Click a cell in the range or table that you want to filter.

  2. On the Data toolbar, click Filter .

    On the Data tab, select Filter

  3. Click the arrow AutoFilter arrow in the column that contains the content that you want to filter.

  4. Under Filter, click Choose One, and then in the pop-up menu, do one of the following:

    To filter for

    Click

    The beginning of a line of text

    Begins With.

    The end of a line of text

    Ends With.

    Cells that contain text but do not begin with letters

    Does Not Begin With.

    Cells that contain text but do not end with letters

    Does Not End With.

  5. In the box next to the pop-up menu, enter the text that you want to use.

  6. Depending on your choice, you may be offered additional criteria to select:

    In the Filter box, select And or Or to add more criteria

    To

    Click

    Filter the table column or selection so that both criteria must be true

    And.

    Filter the table column or selection so that either or both criteria can be true

    Or.

Wildcard characters can be used to help you build criteria.

  1. Click a cell in the range or table that you want to filter.

  2. On the Data toolbar, click Filter.

    On the Data tab, select Filter

  3. Click the arrow AutoFilter arrow in the column that contains the content that you want to filter.

  4. Under Filter, click Choose One, and select any option.

  5. In the text box, type your criteria and include a wildcard character.

    For example, if you wanted your filter to catch both the word «seat» and «seam», type sea?.

  6. Do one of the following:

    Use

    To find

    ? (question mark)

    Any single character

    For example, sm?th finds «smith» and «smyth»

    * (asterisk)

    Any number of characters

    For example, *east finds «Northeast» and «Southeast»

    ~ (tilde)

    A question mark or an asterisk

    For example, there~? finds «there?»

Do any of the following:

To

Do this

Remove specific filter criteria for a filter

Click the arrow AutoFilter arrow in a column that includes a filter, and then click Clear Filter.

Remove all filters that are applied to a range or table

Select the columns of the range or table that have filters applied, and then on the Data tab, click Filter.

Remove filter arrows from or reapply filter arrows to a range or table

Select the columns of the range or table that have filters applied, and then on the Data tab, click Filter.

When you filter data, only the data that meets your criteria appears. The data that doesn’t meet that criteria is hidden. After you filter data, you can copy, find, edit, format, chart, and print the subset of filtered data.

Table with Top 4 Items filter applied

Filter of top four values

Filters are additive. This means that each additional filter is based on the current filter and further reduces the subset of data. You can make complex filters by filtering on more than one value, more than one format, or more than one criteria. For example, you can filter on all numbers greater than 5 that are also below average. But some filters (top and bottom ten, above and below average) are based on the original range of cells. For example, when you filter the top ten values, you’ll see the top ten values of the whole list, not the top ten values of the subset of the last filter.

In Excel, you can create three kinds of filters: by values, by a format, or by criteria. But each of these filter types is mutually exclusive. For example, you can filter by cell color or by a list of numbers, but not by both. You can filter by icon or by a custom filter, but not by both.

Filters hide extraneous data. In this manner, you can concentrate on just what you want to see. In contrast, when you sort data, the data is rearranged into some order. For more information about sorting, see Sort a list of data.

When you filter, consider the following guidelines:

  • Only the first 10,000 unique entries in a list appear in the filter window.

  • You can filter by more than one column. When you apply a filter to a column, the only filters available for other columns are the values visible in the currently filtered range.

  • You can apply filters to only one range of cells on a sheet at a time.

Note: When you use Find to search filtered data, only the data that is displayed is searched; data that is not displayed is not searched. To search all the data, clear all filters.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Watch Video – Excel Advanced Filter

Excel Advanced Filter is one of the most underrated and under-utilized features that I have come across.

If you work with Excel, I am sure you have used (or at least heard about the regular excel filter). It quickly filters a data set based on selection, specified text, number or other such criteria.

In this guide, I will show you some cool stuff you can do using the Excel advanced filter.

But First… What is Excel Advanced Filter?

Excel Advanced Filter – as the name suggests – is the advanced version of the regular filter. You can use this when you need to use more complex criteria to filter your data set.

Here are some differences between the regular filter and Advanced filter:

  • While the regular data filter will filter the existing dataset, you can use Excel advanced filter to extract the data set to some other location as well.
  • Excel Advanced Filter allows you to use complex criteria. For example, if you have sales data, you can filter data on a criterion where the sales rep is Bob and the region is either North or South (we will see how to do this in examples). Office support has some good explanation on this.
  • You can use the Excel Advanced Filter to extract unique records from your data (more on this in a second).

EXCEL ADVANCED FILTER (Examples)

Now let’s have a look at some example on using the Advanced Filter in Excel.

Example 1 – Extracting a Unique list

You can use Excel Advanced Filter to quickly extract unique records from a data set (or in other words remove duplicates).

In Excel 2007 and later versions, there is an option to remove duplicates from a dataset. But that alters your existing data set. To keep the original data intact, you need to create a copy of the data and then use the Remove Duplicates option. Excel Advanced filter would allow you to select a location to get a unique list.

Let’s see how to use an advanced filters to get a unique list.

Suppose you have a dataset as shown below:

Excel Advanced Filter - Sales Dataset

As you can see, there are duplicate records in this data set (highlighted in orange). These could be due to an error in data entry or result of data compilation.

In such a case, you can use Excel Advanced Filter tool to quickly get a list of all the unique records in a different location (so that your original data remains intact).

Here are the steps to get all the unique records:

This will instantly give you a list of all the unique records.

Excel Advanced Filter - Demo

Caution: When you are using Advanced Filter to get the unique list, make sure you have also selected the header. If you don’t, it would consider the first cell as the header.

Example 2 – Using Criteria in Excel Advanced Filter

Getting unique records is one of the many things you can do with Excel advanced filter.

Its primary utility lies in its ability to allow using complex criteria for filtering data.

Here is what I mean by complex criteria. Suppose you have a dataset as shown below and you want to quickly get all the records where the sales are greater than 5000 and the region is the US.

Here is how you can use Excel Advanced Filter to filter the records based on the specified criteria:

This would instantly give you all the records where the region is the US and the sales are more than 5000.

Excel Advanced Filter - complex criteria demo

The above example is a case where the filtering is done based on two criteria (US and sales greater than 5000).

Excel Advanced filter allows you to create many different combinations of criteria.

Here are some examples of how you can construct these filters.

Using the AND Criteria

When you want to use AND criteria, you need to specify it below the header.

For example:

Using the OR Criteria

When you want to use OR criteria, you need to specify the criteria in the same column.

For example:

By now, you must have realized that when we have the criteria in the same row, it is an AND criteria, and when we have it in different rows, it is an OR criteria.

Example 3 – Using WILDCARD Characters in Advanced Filter in Excel

Excel Advanced Filter also allows the usage of wildcard characters while constructing the criteria.

There are three wildcard characters in Excel:

  1. * (asterisk) – It represents any number of characters. For example, ex* could mean excel, excels, example, expert, etc.
  2. ? (question mark) – It represents one single character. For example, Tr?mp could mean Trump or Tramp.
  3. ~ (tilde) – It is used to identify a wildcard character (~, *, ?) in the text.

Now let’s see how we can use these wildcard characters to do some advanced filtering in Excel.

  • To filter records where the sales rep name starts from J. 

Note that * represent any number of characters. So any rep with the name starting with J would be filtered with these criteria.

Similarly, you can use the other two wildcard characters as well.

Note: In case you’re using Office 365, you should check out the FILTER function. It can do a lot of things that advanced filter can do with a simple formula.

NOTE:

  1. Remember, the headers in the criteria should be exactly the same as that in the data set.
  2. Advanced filtering cannot be undone when copied to other locations.

You May Also Like the Following Excel Tutorials:

  • Dynamic Excel Filter – Extract Data as you Type.
  • Filtering Cells with Bold Font Formatting.
  • How to Filter Cells that have Duplicate Text Strings (Words) in it.
  • How to Filter Data in a Pivot Table in Excel
  • MS Guide for Advanced Filter in Excel.
  • How to Compare Two Columns in Excel.
  • Excel VBA Autofilter
  • 20 Advanced Excel Functions and Formulas (for Excel Pros)

What is Filter in Excel?

The filter in excel helps display relevant data by eliminating the irrelevant entries temporarily from the view. The data is filtered as per the given criteria. The purpose of filtering is to focus on the crucial areas of a dataset. For example, the city-wise sales data of an organization can be filtered by the location. Hence, the user can view the sales of selected cities at a given time.

A filter is necessarily required when working with a huge database. Being a widely used tool, the filter converts a comprehensive view into an easy-to-understand one. To apply filters, the dataset must contain a header row which specifies the name of every column.

Table of contents
  • What is Filter in Excel?
    • How to Filter in Excel?
      • Method 1: With Filter Option Under the Home tab
      • Method 2: With Filter Option Under the Data tab
      • Method 3: With the Shortcut key
    • How to Add Filters in Excel?
      • Example #1–“Number Filters” Option
      • Example #2–“Search Box” Option
    • Option while you Drop Down the Filter Function
    • The Techniques of Filtering in Excel
    • Frequently Asked Questions
    • Recommended Articles

How-to-Filter-in-Excel

You are free to use this image on your website, templates, etc, Please provide us with an attribution linkArticle Link to be Hyperlinked
For eg:
Source: Filter in Excel (wallstreetmojo.com)

How to Filter in Excel?

You can download this Filter Column Excel Template here – Filter Column Excel Template

It is good to work with filters because they fit our needs the way we want to. In order to filter data, select the entries to be visible and deselect the rest of the items.

The three methods to add filters in excel are listed as follows:

  1. With filter option under the Home tab
  2. With filter option under the Data tab
  3. With the shortcut key

Let us consider a dataset to go through the three methods of adding filters.

The following table shows the invoices issued to the buyers of different cities. We want to filter the data using different methods.

How to Filter in Excel Example 1

Method 1: With Filter Option Under the Home tab

In the Home tab, there is a “filter” option under the “sort and filter” drop-down of the “editing” section, as shown in the following image.

 Example 1.1

Step 1: Select the data and click “filter” under the “sort and filter” drop-down.

How to Filter in Excel Example 1.2

Step 2: The filters are added to the selected data range. The drop-down arrows, shown within the red boxes in the following image, are filters.

Example 1.3

Step 3: Click the drop-down arrow of the column “city” to view the different names of the cities.

How to Filter in Excel Example 1.4.0

Step 4: To see the invoice values of “Delhi” only, select “Delhi” and uncheck all the remaining boxes.

Example 1.5

Step 5: The data for the city “Delhi” is filtered and displayed in the following image.

How to Filter in Excel Example 1.6

Method 2: With Filter Option Under the Data tab

In the Data tab, there is a “filter” option under the “sort and filter” section, as shown in the following image.

Example 1.7

Method 3: With the Shortcut key

The keyboard shortcutsAn Excel shortcut is a technique of performing a manual task in a quicker way.read more are a good way to speed up the daily tasks. Select the data and add the filter using either of the following shortcuts:

  • Press the keys “Shift+Ctrl+L” together.

How to Filter in Excel Example 1.19

  • Press the keys “Alt+D+F+F” together.

How to Filter in Excel Example 1.18

Note: The preceding shortcuts for adding filtersUsing sorting and filtering, we can see the data category wise. With filtering data quickly you can easily navigate through menus or clicking through a mouse in less time.read more are toggle keys. Repetitive pressing helps to turn on and turn off the filters.

How to Add Filters in Excel?

We can filter numbers using advanced techniques. Let us consider some examples to understand the working of filters in Excel.

Example #1–“Number Filters” Option

Working on the data under the preceding heading (methods of filtering in Excel), we want to apply the following filters:

a. To filter column B (invoice value) for numbers greater than 10000

b. To filter column B for numbers greater than 10000 but less than 20000

Let us go through the two cases one by one.

a. Filter numbers greater than 10000

Step 1: Open the filter in column B (invoice value) by clicking on the filter symbol.

Step 2: In “number filters,” choose the “greater than” option, as shown in the following image.

How to Filter in Excel Example 1.8

Step 3: The “custom autofilter” box appears.

Example 1.9.0

Step 4: Enter the number 10000 in the box to the right of “is greater than.”

How to Filter in Excel Example 1.10

Step 5: The output displays the invoice values greater than 10000. The symbol within the red box is the filter icon. It indicates that the filter has been applied to column B.

Example 1.11

b. Filter numbers greater than 10000 but less than 20000

Step 1: In “number filters,” choose the “greater than” option.

Step 2: In the “custom autofilter” box, select “is less than” in the second box to the left-hand side. This is shown in the following image.

How to Filter in Excel Example 1.12

Step 3: Enter the number 10000 in the box to the right of “is greater than.” Enter the number 20000 in the box to the right of “is less than.”

 Example 1.13

Step 4: The output displays the invoice values greater than 10000 but less than 20000.

How to Filter in Excel Example 1.14

Example #2–“Search Box” Option

Working on the data under the preceding heading (methods of filtering in Excel), we have replaced the first column (city) with product IDs.

We want to filter the details of product ID “prd 1.”

The steps are listed as follows:

Step 1: Add filters to the columns “product ID” and “invoice value.”

Example 1.15

Step 2: In the search boxA search box in Excel finds the needed data by typing into it, then filters the data and displays only that much info. When working with large datasheets, this simple tool may save a lot of time.read more, enter the value that is to be filtered. So, enter “prd 1.”

How to Filter in Excel Example 1.16

Step 3: The output displays only the filtered value from the list, as shown in the following image. Hence, we can see the invoice value of the product ID “prd 1.”

Example 1.17

Option while you Drop Down the Filter Function

  1. Sort A to Z and Sort Z to A: If you wish to arrange your data ascending or descending order.
  2. Sort by Color: If you want to filter the data by color if a cell is filled by color.
  3. Text filter: When you want to filter a column with some exact text or number.
  4. Filter cells that begin with or end with an exact character or the text
  5. Filter cells that contain or do not contain a given character or word anywhere in the text.
  6. Filter cells that are exactly equal or not equal to a detailed character.

For example:

  • Suppose you want to use the filter for a specific item. Click on to text filter and choose equals.

example 1.7

  • It enables you the one dialogue, which includes a Custom Auto-Filter dialogue box.

example 1.8

  • Enter fruits under category and click Ok.

example 1.9

  • Now you will get the data of fruits category only as shown below.

example 1.10

The Techniques of Filtering in Excel

The following techniques must be followed while filtering data:

  • If the dataset is large, type the value to be filtered. This filters all the possible matches.
  • If numerical data has to be filtered by specifying the greater than or the less than number, use the “number filters” option.
  • If data has to be filtered by the color of specific rows, use the “filter by color” option.

Frequently Asked Questions

1. What are filters and how to add them in Excel?

Filtering is a technique which displays the required information and removes the unwanted data from the view. It helps the user focus on the relevant data at a given time.

The steps to add filters in Excel are listed as follows:
• Ensure that a header row appears on top of the data, specifying the column labels.
• Select the data on which filters are to be added.
• Add filters by any of the three given methods.
o Click the “filter” option under the “sort and filter” (editing section) drop-down of the Home tab.
o Click the “filter” option under the “sort and filter” section of the Data tab.
o Press the keys “Shift+Ctrl+L” or “Alt+D+F+F.”

Note: As soon as the filters are added, a drop-down arrow appears on the particular column header.

2. How to apply filters to one or more columns?

The steps to apply filters to one or more columns are listed as follows:
• Click the drop-down arrow of the column to be filtered.
• Uncheck the “select all” option which helps deselect all data.
• Select the boxes to be displayed.
• Click “Ok.”
The drop-down arrow changes to the filter icon as soon as a filter is applied. When filters are applied to multiple columns, the filter icon appears on each one of them. Hovering over the filter icon shows the filters that have been applied.

Note: The drop-down arrow on a column header indicates a filter is added. The filter icon indicates a filter has been applied.

3. How to use filters in Excel?

The filters can be applied to numbers, text values, and dates. These cases are discussed as follows:
Filter numbers
• Click on the “number filters.”
• Select any of the options like “equals,” “does not equals,” “greater than,” “less than,” “between,” “above average,” and so on.
• Specify the required fields in the dialog box that appears. This box may or may not be displayed.

For instance, in “equals,” enter the number against which the values should be compared. The filtered results show the matching numerical values.

Filter text and date values
• To filter text and date values, select “text filters” and “date filters” from the respective drop-down arrows.
• The “text filters” allow filtering text strings which contain specific characters or words. The “date filters” allow filtering dates for a particular year, month, week, and so on.

Note: The “plus” and the “minus” sign of the date filters are used for expanding and collapsing the various levels respectively.

Recommended Articles

This has been a guide to Filter in Excel. Here we discuss how to use/add filters in excel along with step by step examples and a downloadable template. You may learn more about Excel from the following articles –

  • VBA FilterThe VBA Filter tool is used to sort out or fetch the desired data. However, this function accepts optional arguments, and the only required argument is an expression that covers the range, such as worksheets(«Sheet1»). Range(“A1”).read more
  • How to Filter Pivot Table?By right-clicking on the pivot table, we can access the pivot table filter option. Another approach is to use the filter options available in the pivot table fields.read more
  • Advanced Filter in ExcelThe advanced filter is different from the auto filter in Excel. This feature is not like a button that one can use with a single click of the mouse. To use an advanced filter, we have to define criteria for the auto filter and then click on the “Data” tab. Then, in the advanced section for the advanced filter, we will fill our criteria for the data.read more
  • Types of Filters in Power BIThe filter function in Power BI is more commonly used to read data or reports based on multiple criteria. Visual level filters, page-level filters, report-level filters, drill-through filters, and so on are all available filters in Power Bi.read more

Содержание

  1. FILTER function
  2. Examples
  3. Need more help?
  4. Quick start: Filter data by using an AutoFilter
  5. Next steps
  6. Filter data in a range or table
  7. Try it!
  8. Filter a range of data
  9. Filter data in a table
  10. Filter for unique values or remove duplicate values
  11. Remove duplicate values
  12. Need more help?

FILTER function

The FILTER function allows you to filter a range of data based on criteria you define.

In the following example we used the formula =FILTER(A5:D20,C5:C20=H2,»») to return all records for Apple, as selected in cell H2, and if there are no apples, return an empty string («»).

The FILTER function filters an array based on a Boolean (True/False) array.

The array, or range to filter

A Boolean array whose height or width is the same as the array

The value to return if all values in the included array are empty (filter returns nothing)

An array can be thought of as a row of values, a column of values, or a combination of rows and columns of values. In the example above, the source array for our FILTER formula is range A5:D20.

The FILTER function will return an array, which will spill if it’s the final result of a formula. This means that Excel will dynamically create the appropriate sized array range when you press ENTER. If your supporting data is in an Excel table, then the array will automatically resize as you add or remove data from your array range if you’re using structured references. For more details, see this article on spilled array behavior.

If your dataset has the potential of returning an empty value, then use the 3rd argument ( [if_empty]). Otherwise, a #CALC! error will result, as Excel does not currently support empty arrays.

If any value of the include argument is an error (#N/A, #VALUE, etc.) or cannot be converted to a Boolean, the FILTER function will return an error.

Excel has limited support for dynamic arrays between workbooks, and this scenario is only supported when both workbooks are open. If you close the source workbook, any linked dynamic array formulas will return a #REF! error when they are refreshed.

Examples

FILTER used to return multiple criteria

In this case, we’re using the multiplication operator (*) to return all values in our array range (A5:D20) that have Apples AND are in the East region: =FILTER(A5:D20,(C5:C20=H1)*(A5:A20=H2),»»).

FILTER used to return multiple criteria and sort

In this case, we’re using the previous FILTER function with the SORT function to return all values in our array range (A5:D20) that have Apples AND are in the East region, and then sort Units in descending order: =SORT(FILTER(A5:D20,(C5:C20=H1)*(A5:A20=H2),»»),4,-1)

In this case, we’re using the FILTER function with the addition operator (+) to return all values in our array range (A5:D20) that have Apples OR are in the East region, and then sort Units in descending order: =SORT(FILTER(A5:D20,(C5:C20=H1)+(A5:A20=H2),»»),4,-1).

Notice that none of the functions require absolute references, since they only exist in one cell, and spill their results to neighboring cells.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Источник

Quick start: Filter data by using an AutoFilter

By filtering information in a worksheet, you can find values quickly. You can filter on one or more columns of data. With filtering, you can control not only what you want to see, but what you want to exclude. You can filter based on choices you make from a list, or you can create specific filters to focus on exactly the data that you want to see.

You can search for text and numbers when you filter by using the Search box in the filter interface.

When you filter data, entire rows are hidden if values in one or more columns don’t meet the filtering criteria. You can filter on numeric or text values, or filter by color for cells that have color formatting applied to their background or text.

Select the data that you want to filter

On the Data tab, in the Sort & Filter group, click Filter.

Click the arrow in the column header to display a list in which you can make filter choices.

Note Depending on the type of data in the column, Microsoft Excel displays either Number Filters or Text Filters in the list.

Filter by selecting values or searching

Selecting values from a list and searching are the quickest ways to filter. When you click the arrow in a column that has filtering enabled, all values in that column appear in a list.

1. Use the Search box to enter text or numbers on which to search

2. Select and clear the check boxes to show values that are found in the column of data

3. Use advanced criteria to find values that meet specific conditions

To select by values, in the list, clear the (Select All) check box. This removes the check marks from all the check boxes. Then, select only the values you want to see, and click OK to see the results.

To search on text in the column, enter text or numbers in the Search box. Optionally, you can use wildcard characters, such as the asterisk ( *) or the question mark ( ?). Press ENTER to see the results.

Filter data by specifying conditions

By specifying conditions, you can create custom filters that narrow down the data in the exact way that you want. You do this by building a filter. If you’ve ever queried data in a database, this will look familiar to you.

Point to either Number Filters or Text Filters in the list. A menu appears that allows you to filter on various conditions.

Choose a condition and then select or enter criteria. Click the And button to combine criteria (that is, two or more criteria that must both be met), and the Or button to require only one of multiple conditions to be met.

Click OK to apply the filter and get the results you expect.

Next steps

Experiment with filters on text and numeric data by trying the many built-in test conditions, such as Equals, Does Not Equal, Contains, Greater Than, and Less Than. For more information, see Filter data in a range or table.

Note Some of these conditions apply only to text, and others apply only to numbers.

Create a custom filter that uses multiple criteria. For more information, see Filter by using advanced criteria.

Источник

Filter data in a range or table

Try it!

Use filters to temporarily hide some of the data in a table, so you can focus on the data you want to see.

Filter a range of data

Select any cell within the range.

Select Data > Filter.

Select the column header arrow .

Select Text Filters or Number Filters, and then select a comparison, like Between.

Enter the filter criteria and select OK.

Filter data in a table

When you Create and format tables, filter controls are automatically added to the table headers.

Select the column header arrow for the column you want to filter.

Uncheck (Select All) and select the boxes you want to show.

The column header arrow changes to a Filter icon. Select this icon to change or clear the filter.

Источник

Filter for unique values or remove duplicate values

In Excel, there are several ways to filter for unique values—or remove duplicate values:

To filter for unique values, click Data > Sort & Filter > Advanced.

To remove duplicate values, click Data > Data Tools > Remove Duplicates.

To highlight unique or duplicate values, use the Conditional Formatting command in the Style group on the Home tab.

Filtering for unique values and removing duplicate values are two similar tasks, since the objective is to present a list of unique values. There is a critical difference, however: When you filter for unique values, the duplicate values are only hidden temporarily. However, removing duplicate values means that you are permanently deleting duplicate values.

A duplicate value is one in which all values in at least one row are identical to all of the values in another row. A comparison of duplicate values depends on the what appears in the cell—not the underlying value stored in the cell. For example, if you have the same date value in different cells, one formatted as «3/8/2006» and the other as «Mar 8, 2006», the values are unique.

Check before removing duplicates: Before removing duplicate values, it’s a good idea to first try to filter on—or conditionally format on—unique values to confirm that you achieve the results you expect.

Follow these steps:

Select the range of cells, or ensure that the active cell is in a table.

Click Data > Advanced (in the Sort & Filter group).

In the Advanced Filter popup box, do one of the following:

To filter the range of cells or table in place:

Click Filter the list, in-place.

To copy the results of the filter to another location:

Click Copy to another location.

In the Copy to box, enter a cell reference.

Alternatively, click Collapse Dialog to temporarily hide the popup window, select a cell on the worksheet, and then click Expand .

Check the Unique records only, then click OK.

The unique values from the range will copy to the new location.

When you remove duplicate values, the only effect is on the values in the range of cells or table. Other values outside the range of cells or table will not change or move. When duplicates are removed, the first occurrence of the value in the list is kept, but other identical values are deleted.

Because you are permanently deleting data, it’s a good idea to copy the original range of cells or table to another worksheet or workbook before removing duplicate values.

Follow these steps:

Select the range of cells, or ensure that the active cell is in a table.

On the Data tab, click Remove Duplicates (in the Data Tools group).

Do one or more of the following:

Under Columns, select one or more columns.

To quickly select all columns, click Select All.

To quickly clear all columns, click Unselect All.

If the range of cells or table contains many columns and you want to only select a few columns, you may find it easier to click Unselect All, and then under Columns, select those columns.

Note: Data will be removed from all columns, even if you don’t select all the columns at this step. For example, if you select Column1 and Column2, but not Column3, then the “key” used to find duplicates is the value of BOTH Column1 & Column2. If a duplicate is found in those columns, then the entire row will be removed, including other columns in the table or range.

Click OK, and a message will appear to indicate how many duplicate values were removed, or how many unique values remain. Click OK to dismiss this message.

Undo the change by click Undo (or pressing Ctrl+Z on the keyboard).

You cannot remove duplicate values from outline data that is outlined or that has subtotals. To remove duplicates, you must remove both the outline and the subtotals. For more information, see Outline a list of data in a worksheet and Remove subtotals.

Note: You cannot conditionally format fields in the Values area of a PivotTable report by unique or duplicate values.

Follow these steps:

Select one or more cells in a range, table, or PivotTable report.

On the Home tab, in the Style group, click the small arrow for Conditional Formatting, and then click Highlight Cells Rules, and select Duplicate Values.

Enter the values that you want to use, and then choose a format.

Follow these steps:

Select one or more cells in a range, table, or PivotTable report.

On the Home tab, in the Styles group, click the arrow for Conditional Formatting, and then click Manage Rules to display the Conditional Formatting Rules Manager popup window.

Do one of the following:

To add a conditional format, click New Rule to display the New Formatting Rule popup window.

To change a conditional format, begin by ensuring that the appropriate worksheet or table has been chosen in the Show formatting rules for list. If necessary, choose another range of cells by clicking Collapse button in the Applies to popup window temporarily hide it. Choose a new range of cells on the worksheet, then expand the popup window again . Select the rule, and then click Edit rule to display the Edit Formatting Rule popup window.

Under Select a Rule Type, click Format only unique or duplicate values.

In the Format all list of Edit the Rule Description, choose either unique or duplicate.

Click Format to display the Format Cells popup window.

Select the number, font, border, or fill format that you want to apply when the cell value satisfies the condition, and then click OK. You can choose more than one format. The formats that you select are displayed in the Preview panel.

In Excel for the web, you can remove duplicate values.

Remove duplicate values

When you remove duplicate values, the only effect is on the values in the range of cells or table. Other values outside the range of cells or table will not change or move. When duplicates are removed, the first occurrence of the value in the list is kept, but other identical values are deleted.

Important: You can always click Undo to get back your data after you have removed the duplicates. That being said, it’s a good idea to copy the original range of cells or table to another worksheet or workbook before removing duplicate values.

Follow these steps:

Select the range of cells, or ensure that the active cell is in a table.

On the Data tab, click Remove Duplicates .

In the Remove Duplicates dialog box, unselect any columns where you don’t want to remove duplicate values.

Note: Data will be removed from all columns, even if you don’t select all the columns at this step. For example, if you select Column1 and Column2, but not Column3, then the “key” used to find duplicates is the value of BOTH Column1 & Column2. If a duplicate is found in Column1 and Column2, then the entire row will be removed, including data from Column3.

Click OK, and a message will appear to indicate how many duplicate values were removed. Click OK to dismiss this message.

Note: If you want to get back your data, simply click Undo (or press Ctrl+Z on the keyboard).

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Источник

This post will guide you how to extracts matched values using FILTER function in Microsoft Excel 365. And also will introduce that how to use FILTER function with same examples in Excel 365.

Table of Contents

  • Excel Filter Function
  • Entering FILTER Formula in Excel
  • Excel filtering by a single criteria
    • Example 1: How to use a number as a filter
    • Example 2: How to filter in Excel by a cell value
    • Example 3: Using Excel’s text filter
    • Example 4: Using NOT EQUAL TO as a FILTER condition in Excel
    •  Example 5: How to use the date filter in Excel
    • Example 6: Filtering by date in Excel
    • Example 7: Filtering based on two Conditions
    • Example 8: Filtering Based on Two Conditions using OR Logic
    • Example 9: Filter Data in Excel from Another Sheet
    • Example 10: Providing Maximum Number of Rows of Filtered Data
  • Conclusion
    • Related Functions

The FILTER function “filters” a set of data according to the conditions specified. The outcome is an array of values that match those in the original range. Simply said, the FILTER function extracts matched records from a collection of data using one or more logical checks. The include argument specifies logical tests, which might encompass a wide variety of formula conditions. For instance, FILTER may match data from a given year or month, data containing specific content, or numbers above a specified threshold.

=FILTER(array,include,[if empty])

Three parameters are required for the FILTER function: array, include, and if empty.

Where:

  • Array – This is required argument. The range or array to filter is specified by array.
  • Include – This is required argument. Include one or more logical tests in the include These tests should return TRUE or FALSE depending on the array values evaluated.
  • If_empty – This is option argument. The last input, if empty, specifies the value to return if FILTER does not discover any matching values. Typically, this is a message along the lines of “No records found,” although other values may also be returned. To show nothing, provide an empty string (“”).

Entering FILTER Formula in Excel


FILTER provides dynamic results. When the values in the source data change or the size of the source data array changes, the FILTER results are updated automatically. The results of FILTER will “leak” into numerous cells on the worksheet.

To filter data in Excel using the FILTER function, follow these steps:

Step1: To begin your filter formula, enter =FILTER(.

Step2: Enter the address for the range of cells containing the data you want to filter, for example, A2:C10.

Step3: Type a comma, followed by the filter's condition, such as B2:B20>3 (To specify a condition, type the address of the “criteria column,” such as C1:C, followed by an operator symbol such as greater than (>), and finally the criterion, such as the number 3.

Step4: Complete the parenthesis with a closing parenthesis and then hit enter on the keyboard. Your full formula will appear as follows: =FILTER(A2:C10, B2:B20>3)

I’ll begin with the fundamentals of utilizing the FILTER function, and then demonstrate some more advanced uses of the FILTER function. This article discusses the FILTER function as a formula entered into spreadsheet cells, not the filter command accessible from the toolbar and pop-up menus.

While using the FILTER function in Excel is almost identical to using it in Google Sheets, there are some subtle variations.

Excel filtering by a single criteria


To begin, let’s review how to use Excel’s FILTER function in its simplest version, with a single condition/criteria.

I’ll demonstrate how to filter data using a number, a cell value, a text string, or a date… and I’ll also demonstrate how to utilize a variety of “operators” in the filter condition (Less than, Equal to, etc…).

Example 1: How to use a number as a filter


In this first demonstration of how to use the filter tool in Excel, we have a list of students and their grades and wish to create a filtered list of only students with flawless grades.

The assignment: Display a list of students and their grades, but only those who have earned an A.

The reasoning: Filter the range A2:B10 for values larger than 0.7 in the column B2:B10 (70 percent ). Then you can use the following FILTER formula,type:

=FILTER(A2:B10, B2:B10 >0.7)

excel filter function

Example 2: How to filter in Excel by a cell value


In this excel filter function example, we want to do the same thing as stated before, but rather than inputting the condition straight into the formula, we’re going to use a cell reference.

When you filter in Excel by a cell value, your sheet is configured in such a way that you may alter the value in the cell at any moment, which updates the value to which the filter criterion is tied.

In this example, rather than explicitly entering the value “0.8” into the formula, the filter criterion is set to cell G1, which contains the “0.8” value.

The assignment: Display a list of students and their grades, but only those with a score of less than 80%.

The reasoning: Filter the range A2:B10 to the extent that B2:B10 is smaller than the value supplied in column G1 (0.8).

You can use the following FILTER formula, type:

=FILTER(A2:B10, B2:B10 <G1)

excel filter function

Example 3: Using Excel’s text filter


In this example, we’ll utilize a text string as the filter formula’s criterion. This is fairly similar to using a number, except that the text to filter must be enclosed in quote marks.

We are filtering a list of customers and their payment status in this instance, and we want to present just customers with a payment status of “Payed“.

The objective is to provide a list of clients that have paid on their payments.

The reasoning: Filter the range A2:B6 by substituting the string “ Payed ” for B2:B6.

The following formula: In this example, the formula below is typed in the cell (E1).

=FILTER(A3:B12, B2:B6=" Payed ")

excel filter function

Example 4: Using NOT EQUAL TO as a FILTER condition in Excel


Now that you have a working knowledge of how to use the filter function in Excel, here is another example of filtering by a string of text, but this time we will use the “not equal” operator (<>) to demonstrate how to filter a range and return data that is NOT equal to the criteria you set.

Additionally, we will utilize a bigger data set in this example to show a more comprehensive usage of the FILTER function in the real world.

You may be surprised at how often a circumstance arises in which you need to filter data that is “not equal to” a certain number or piece of text.

In this example, we’ll use a report/spreadsheet to display data from sales calls that occur at your organization, and we’ll filter the data to exclude a certain sales person (Scott) from the result.

The assignment: Display sales call statistics for all sales representatives except ” Scott “.

The reasoning: Filter the range A2:C10 for values A2:A10 that DO NOT match the string “Scott “.

The following formula: In this example, the formula below is typed in the cell (E1).

=FILTER(A2:C10, A2:A10 <>"Scott")

excel filter function

Take note that the filtered data on the right side of the figure above does not include any of Scott ‘s rows/calls.

 Example 5: How to use the date filter in Excel


Filtering in Excel by a date may be accomplished in a few different methods, which I will demonstrate below. If you attempt to put a date into the FILTER function in the same way that you would typically type into a cell, the formula will fail to operate properly.

Therefore, you may either enter the date you want to filter into a cell and then reference that cell in your formula… Alternatively,  you may use the DATE function.

When filtering by date, the same operators (>, =, etc…) are available as they are in other FILTER function applications. Each individual day/date in Excel is merely a number that has been formatted differently. In Excel, for example, the date “01/30/2022” is just the serial number “44591” formatted as a date. Each time you add a day to the calendar, this number increases by one… For example, “44591” “44592” “44593”

Thus, if one date is farther in the future, it might be regarded “greater than” another. In contrast, if one date is farther in the past, it might be considered to be “less than” another.

In this example, we’ll use a cell reference to filter on a date. This is identical to the example discussed in Example 2, except that we are dealing with dates instead of percentages.

Consider the following scenario: we want to filter a list of students, their exam results, and the dates on which the tests were administered… and we wish to display only tests conducted before to June (05/01/2022).

=FILTER(A2:C10, C2:C10 <G1)

excel filter function

Example 6: Filtering by date in Excel


In this example of date filtering in Excel, we’ll use the same data as in the previous one and attempt to obtain the same results… however, instead of referencing a cell, we’ll utilize the DATE function, which allows you to put the date straight into the FILTER function.

When using the DATE function to provide a date, you must first input the year, followed by the month and finally the day… each denoted with a comma (shown below).

The assignment: Display only exams given before to May

The reasoning: Filter the range A2:C10 so that C2:C10 is less than or equal to the date (05/01/2022).

The following formula: In this example, the formula below is typed in the cell (D3).

=FILTER(A2:C10,C2:C10<DATE(2022,5,1))

excel filter function

Example 7: Filtering based on two Conditions


When utilizing the Excel FILTER function, you may want to produce data that fits many criteria. I’ll demonstrate two methods for filtering by several criteria in Excel, depending on the scenario and the desired behavior of the calculation.

The conventional method of adding another condition to your filter function (as shown by the Excel formula syntax) allows you to provide a second condition, where both the first AND second conditions must be fulfilled in order for the filter output to be returned.

However, I will demonstrate how to make a little tweak to the function so that you may choose to return/display in the filter function’s output/destination a second condition where EITHER condition might be satisfied. (To utilize AND logic, separate the conditions with an asterisk, or use a plus symbol to separate the criteria.)

In this example, we’re going to filter a collection of data and show those rows that satisfy BOTH the first and second conditions.

To utilize a second condition in this manner (using AND logic), just insert it after the first condition in the formula, separated by an asterisk (*). Each condition must be included in a separate pair of parentheses.

When a filter formula is used with several conditions, the columns referenced in each condition must be distinct.

In this case, we’d want to filter a list of clients based on their payment status and region… and to display those customers who are both current members AND paid on their payment status.

The objective is to provide a list of customers who are paid on payments, but only those who are in East region.

The reasoning: Filter the range A2:C6 such that B2:B6 equals the text “Paid,” AND C2:C6 equals the text “East“.

The following formula: In this example, the formula below is typed in the blue cell (E1).

=FILTER(A2:C6,( B2:B6="Paid")*( C2:C6 ="East"))

excel filter function

Example 8: Filtering Based on Two Conditions using OR Logic


In this example, we’re going to filter a collection of data and show those rows that satisfy either the first OR the second criterion.

To utilize a second condition in this manner (using OR logic), just insert it after the first condition in the formula, separated by a plus sign. Each condition must be included in a separate pair of parentheses (shown below).

When used in this manner, the FILTER formula allows you to choose criteria from the same or separate columns.

In this case, we’re filtering the same customer data as in the previous example, but this time we’re displaying a list of customers who either are in East region OR have paid on a payment. This will generate a list of clients to whom a payment notification have paid… whether they are current members or east region who have paid on their last payment.

The objective is to provide a list of customers who are in East region, as well as customers who have paid on payments regardless of whether they are in East region.

The following formula: In this example, the formula below is typed in the cell (E1).

=FILTER(A2:C6, (B2:B6="Paid ")+(C2:C6=" East ")

excel filter function

Example 9: Filter Data in Excel from Another Sheet


You may often encounter instances in Excel when you need to filter data from another sheet, where your raw unfiltered data is on one tab and your filter formula is on another sheet.

This may be accomplished by simply referring to a certain sheet’s name when providing the filter’s ranges. Thus, while you would typically give a range such as “A1:B4,” when referring another sheet when filtering, you indicate the sheet name by preceding the range with the sheet name and an exclamation mark, as in “SheetName!A1:B4“.

However, if the sheet name contains a space, an apostrophe must be used before and after the sheet name, as in "Sheet Name!" A1:B4.

The following is an example of how to filter data in Excel from a separate sheet, where the filter formula is located on a different sheet than the source range.

Consider the following scenario: On one sheet, you have a list of customers and their payment status, and you wish to present a filtered list of  paid customer on another sheet.

The job is to filter the list of customers on the Sheet3 and to display a separate list of customer names with a pay status on another worksheet.

The reasoning: Filter the range using the Sheet3 command! A2:C6, where ‘ Sheet3′ is the range! B2:B6 corresponds to the phrase “Paid“.

The following formula: In this example, the formula below is typed in the cell (A3).

=FILTER(Sheet3! A2:C6, Sheet3!B2:B6="Paid")

excel filter function

Example 10: Providing Maximum Number of Rows of Filtered Data


If your FILTER formula provides a large number of rows but your worksheet is restricted in space and you are unable to erase the data below, you may limit the amount of rows returned by the FILTER function.

Let us demonstrate how it works using a simple formula that filter data that grade is less than 0.7 from filter value in Cell F1:

=FILTER(A2:C10, B2:B10<F1)

excel filter function

The preceding formula produces all records that it discovers, in this instance five rows. However, imagine you only have room for two. To output just the first two rows discovered, follow these steps:

Step1: Incorporate the FILTER formula into the INDEX function’s array parameter

Step2: Use a vertical array constant such as 1;2 as the row num input to INDEX. It specifies the number of rows to return (2 in our case).

Step3: Use a horizontal array constant such as 1,2 for the column num parameter. It defines the columns that should be returned (the first 2 columns in this example).

Step4: To account for any mistakes caused by the absence of data meeting your criteria, you may wrap your calculation in the IFERROR function.

The entire excel filter formula is as follows:

=IFERROR(INDEX(FILTER(A2:C10, B2:B10<F1), {1;2},{1,2}), "No Found")

excel filter function

Conclusion


This section discusses the FILTER function and its many uses. In general, when it comes to time management, we need this feature for a variety of reasons. I demonstrated various techniques with accompanying examples, however there might be countless further iterations based on a variety of circumstances. If you know of another way to use this function, please share it with us.


  • Excel IFERROR function
    The Excel IFERROR function returns an alternate value you specify if a formula results in an error, or returns the result of the formula.The syntax of the IFERROR function is as below:= IFERROR (value, value_if_error)….
  • Excel INDEX function
    The Excel INDEX function returns a value from a table based on the index (row number and column number)The INDEX function is a build-in function in Microsoft Excel and it is categorized as a Lookup and Reference Function.The syntax of the INDEX function is as below:= INDEX (array, row_num,[column_num])…

Disclosure: Some of the links on this site are affiliate links, meaning that if you click on one of the links and purchase an item, I may receive a commission. All opinions however are my own.

Excel program is one of the most used spreadsheet programs.

If you don’t know its advantages, then let me tell you, with the excel program you can do various calculations, advanced filter excels, maintain data, perform mathematical operations, auto filter excel, create spreadsheets, and lots more features are there provided by excel program.

Today, we will be discussing the procedure of How to filter in excel. If you don’t know what actually a filter function is, the basic intro is given below. Have a look at that.

Filtering in excel simply means displaying certain data. In other words, filtering means setting a condition, so that only certain data is displayed.

For example, when you have a large number of data, and you want to display particular information, then all you will have to do is, filter the data. Once the data is filtered, and the condition is set to show the certain data, the only data that you chose to filter would display.

How to Filter in Excel

In excel filter multiple columns can also be done. In the article, we will let you know the complete step-by-step guide to filter the data. Along with the filtering in excel. We will be also telling you the procedure for advance filtering.

Check out the guide and let me know, how do you find it. The steps are described below. If you face any difficulty in any step, do ask that by dropping the comment below.

Step 1: First of all, enter the data in the excel sheet you want to filter. For example, as you can see below, in the image I have mentioned some data. In the data below, I have mentioned the rows with Sr. No., Customer ID, amount, Country, and years. Check the image below.  

Now here, we have to filter the data. For example, I want to display the Country UK, along with the year 2015. So how do we do that? I have shown it below. Simply follow the second step.

Step 2: In order to apply the filter function to the sheet, first select the rows you want to apply the filter function to, and then go to the Data tab from the menu bar, and select Filter. The screenshot is given below.

Step 3: As sooner you click on the filter option, a drop-down arrow will appear in the header cell for each column. Check out the image below.

Remember, In order for filtering data properly, your worksheet should include a header row, it is used to identify the name of each column. As in our example sheet, we have taken the header column as Sr. No., Customer ID, amount, Country, and years.

Step 4: Now, as we have to filter the Country UK, we will have to click n the drop-down arrow from the country column. Once done, apply the same procedure for the year or for any data you want to filter.

As sooner you will click on the arrow button. you will see a screen as I have mentioned below.

Step 5: As you can see in the above image, there are basically three options appearing. UK, USA, and Select All. If there would be more countries, all would have been showing in the list. But as I have mentioned only two of the countries, we have to select from them.

As I told you above, I want to display the list of Uk, I will check the box of UK and Uncheck the rest of the checkboxes. As sooner I will do that, the only country UK will start displaying.

And the filtering arrow in the table header changes to this icon. This indicates a filter is applied. To make any changes or clear the filter, click on this icon.

I have mentioned the screenshot below. If you finding difficulty in understanding, keep referring to the screenshots.

Step 6: And you are done. This is how we filter data in an excel program.

This was the first method to perform a filter in excel. Another method is given below.

Step 1: To perform the filter, select the cell first. Once done, right-click on it and then click Filter. See the screenshot below.

filter

Step 2: As it is clearly visible in the above image, after clicking on the filter option, a small drop-down will appear. All you have to do is click on the Filter by Selected Cell’s Value. And you are done!!

So, these were the basic two methods to perform filters in excel. I hope you got all the steps clear. You must have. Along with the steps, I also have provided the screenshot. But still, if you find any difficulty you can drop the comment below.

Ok, so this was about how to filter in excel. The methods I shown above are simple filtering methods. But below, I am going to show you how excel advanced filter is performed.

However, an advanced filter in excel is not as easy as simple filtering. You may find advanced filtering a little complex than the simple filter. But, once you manage to perform the advanced filter, you may find it more beneficial. Check out the given below.

Step 1: To perform advanced filter in excel. first, click on the Data tab from the menu bar. And then select Advanced. 

Step 2: After you click on the advanced option, the Advanced Filter dialog box will open up. And you will see a screen as I have mentioned below.

excel filter multiple columns

Now here, all you have to do is fill in the details, and then click the OK button to filter the data. And the data would be filtered.

So, this how-to filter in excel. I hope the given guide will help you to perform a filter in your excel sheet. In case, of any confusion, you can drop your comment. We will try to reach out to you as soon as possible.

If you know any other method to perform filter in excel, you can share it with us.

Also, do check out our previous guide excel by clicking here. You can also consider sharing the guide if you find it useful.

Quick Links 

  • How To Multiply In Excel
  • How To Create A Drop Down List in Excel
  • How To Update Google Chrome  A Basic Guide To Update Google Chrome

3 Ways to Filter Data in Excel

One of the most common things that I witness people (pros or amateurs / seniors or juniors) doing is applying filters to data. I mean it is so common that everyone knows it around. Agreed !

What I am going to share with you is 3 uncommon, incredibly smart ways of applying filters and not just filtering data but will also show you uncanny ways of automating filters

Method 1 – Auto Filter

This is a shortcut and will probably blow you away once you see how simple is it to use it.

Method 2 – Advanced Filter + Automation

Using advanced filter you can filter data for more complex conditions and even automate that using a tiny VB Code

Code for Pasting Filtered Data to another location

Sub My_Filter_Macro()

Range(“SalesData[#All]“).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range(“Condition[#All]“), CopyToRange:=Range(“Extract“), _
Unique:=False

End Sub

Code for Filtering data (without pasting it to another location)

Sub My_Filter_Same_Data()

Range(“SalesData[#All]“).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range(“Condition[#All]“), Unique:=False

End Sub

To paste this code

  1. Open the VBA Window (Alt F11)
  2. In the menu click on Insert and then click on Module
  3. In the blank space, paste the code (make changes to the code if needed)
  4. Sweet..Done!

Method 3 – Filter Data using Slicers

You’ll feel like a King if you are working with Excel 2013 and above. Because you can use these nifty slicers to filter your data. Take a look

DOWNLOAD THE EXCEL FILE – with all methods + make sure to enable macros before you start toying with it

Create Dashboards using Slicers & Advanced Filter

  1. Create a Dashboard in 15 Mins – A small case where I’ll share simple tricks and hacks to make a quick dashboard using Filters Slicers and Formulas
  2. Advanced Filter Dashboard – Now since slicers work in Excel 2013 and above, you don’t have to feel disheartened. You can use advanced filter to create similar dashboard!

Topics that I write about…


Chandeep

Welcome to Goodly! My name is Chandeep.
On this blog I actively share my learning on practical use of Excel and Power BI. There is a ton of stuff that I have written in the last few years. I am sure you’ll like browsing around.
Please drop me a comment, in case you are interested in my training / consulting services. Thanks for being around
Chandeep


Skip to content

How to Filter in Excel: Full Step-by-Step Guide (2023)

How to Filter in Excel: Full Step-by-Step Guide (2023)

Working with large datasets in Excel can make it hard to find relevant information.

The filter tool offered by Microsoft Excel makes it easy for users to narrow down their data to find what’s relevant.

To learn more about the filter tool of Excel (both basic and advanced), jump right into the article below.

Also, as you scroll down, download our sample workbook for free here.

How to filter in Excel

The filter tool of Excel is a quick way to filter out the desired information only.

For example, the image below contains the sale data for some products.

Data for the sale of goods

1. Apply filters to this data by selecting the header of the column where the filter is to be applied.

2. For example, if you want to filter sales based on product name, select the header for products.

Selecting the relevant header

3. Go to the Data Tab > Sort & Filter > Filter.

Applying filters to data

Pro Tip!

There are two alternate shortcuts that you can use to apply filters to your data.

  1. Go to Home > Editing Group > Sort & Filter > Filter
  2. Use the keyboard shortcut to add filters – Control Key + Shift + L

4. This adds drop-down arrows to the selected column header (Products in this case).

Drop-down arrows added to the products header

5. The filter is already applied, and you can now use it to filter our information as desired.

The filter applied

Must note that to apply filters, your data must have a proper column header where the filter is to be applied.

Using the filter tool, you can apply filters based on numeric or text values, format, or by criteria.

Kasper Langmann, Microsoft Office Specialist

How to filter by text

Can you quickly filter out the sales of Apples made during the period❓

Simple. From the list of products, filter out the text ‘Apples’. The sales of Apples would be automatically filtered.

1. Apply filters to the column of products as explained above.

Drop-down arrows added to the product header

2. Click on the drop-down menu to launch the filter options.

3. The filter tool shows all the items that appear in the selected column.

All items in the selected column

4. From these items, uncheck all others, except for ‘Apples’.

Checking and unchecking

5. Click Okay, and you’re good to go!👍

6. Excel filters out the sales of ‘Apples’ only

Sales of Apples filtered

Quickly applying the SUM function to this sale tells that the total sales for Apples were $2940.

To save time that goes into checking and unchecking items, type the desired text (Apples) in the Search bar above and press Enter.

Kasper Langmann, Microsoft Office Specialist

How to filter by numbers

Next is filtering in Excel using numbers.

The AutoFilter tool of Excel allows you to filter data based on numbers in a variety of ways.

Check out the variety of options in the image below.

Options to filter numbers

You can set up any parameter. Like filtering numbers that equal to say $1000 or are less / more than $1000 or whatever.

Alternatively, you can simply sort numbers in descending or ascending order.

In the above example, let’s apply a filter based on numbers. For instance, let’s filter out the sales that are equal to or less than $400.

1. Select the column for Total Sales and apply the filter tool to it.

2. Launch the filter tool by clicking on the drop-down arrow.

3. Go to Number Filters.

Number filters

4. To filter out the sales that are equal to or less than $400, choose an appropriate parameter.

Less than or equal to

5. This launches the Custom AutoFilter dialog box.

The Custom AutoFilter dialog box.

6. Against the ‘Less than or Equal to’ tab, input the number ‘400.

Inputting values Custom AutoFilter dialog box.

7. Click Okay.

8. Excel filters the sales as follows.

Excel filters based on numbers.

Excel has filtered out sales that were only equal to or less than $400.

Multiple filters simultaneously

Can you apply filters to multiple columns simultaneously?

For example, for the above data set, what if we want to filter out sales for Apples that are greater than $800?

This takes two filters:

  1. Text filters to filter out sales for the Product ‘Apples’.
  2. Number filters to filter out sales of Apples that exceed $800.

No worries. It’s still a piece of cake. See below.

1. Apply filters to the Product column.

2. From the filter drop-down menu, select ‘Apples’ to filter out sales for ‘Apples’ only.

Applying the 'Apples' filter to products

3. Click ‘Okay’ and Excel filters out the sales of ‘Apples’ only

Sales of Apples filtered

4. Next, apply filters to the column ‘Total Sales.’

5. Launch the filter tool by clicking on the drop-down arrow against the column heading ‘Total Sales”.

6. Go to Number Filters.

Number filters

7. To filter out the sales that are more than $800, choose an appropriate parameter.

Greater than.

8. This launches the Custom AutoFilter dialog box. Against the ‘Greater than’ tab, input the number 800.

 Inputting values Custom AutoFilter dialog box.

9. Click Okay, and Excel filters the sales as follows.

Filter cells based on numbers.

There you go! The AutoFilter tool filters out the sales of Apples that exceed $800.

You can apply as many filters as desired at any given time.

Pro Tip!

How do you know which columns of your data have the filter applied?🙋‍♂️

Look out for the filter (funnel) icon in place of the drop-down arrow. All the column headers that have this icon have the filter applied.

How to clear filters in Excel

There’s an undo to everything you do in Excel.

After you’ve applied filters to data, the drop-down menu for that column header takes a filter shape.

Filter in place of the drop-down arrow

In this example, we have applied the filter to the column ‘Products’ to filter out the sales for ‘Apples’ only.

1. To remove this filter, go to the filter icon of the relevant column.

2. Launch the AutoFilter tool.

3. Select the option “Remove Filters.”

Removing filters from a column.

4. Alternatively, Go to Data > Sort & Filter > Clear.

Clear Filter option to clear filter cells.

5. This removes the filter “Apples” applied to Products.

Filters removed from Products

Excel now shows all the products (apples, oranges, and kiwi).

Also, note how the filter icon is now again replaced by the drop-down arrow.

How to remove filters entirely

In the above section, we’ve seen how to remove filters from a particular filter column.

But what if you want to remove filters from your data set entirely?

1. Select the data from where you want to remove filters.

2. Go to Data > Sort & Filter > Click Filter Button again.

Clear Filter option.

This removes the AutoFilter from the data.

3. No more drop-down arrows.

Drop-down arrows removed

Remember the shortcut to Apply Filters? Control Key + Shift + L.

Press these three keys together to apply filters. Press them again together to remove the filters.

Kasper Langmann, Microsoft Office Specialist

Filter by color in Excel

You can also use the AutoFilter Tool of Excel to filter out specific cells based on their color.

For example, the image below shows the marks of different students.

Applying filters to highlighted cell icon.

There’s also a key to the right side that tells how the coloring is done.

Let’s filter out the students who’ve passed.

1. Apply filters to the column that has the highlighted cells.

Selecting the Blue color.

2. Launch the filter tool. Go to ‘Filter By Color’ and select the color blue.

We have selected the color blue as the key shows that the students who’ve passed are highlighted in blue.

Selecting the Blue color.

And there you go! Excel only filters the cells that are highlighted in blue.

Excel filters out blue cells.

Advanced Filter in Excel

As the name suggests, advanced filters go a step beyond AutoFilters.

Using the advanced filters tool of Excel, you can apply multiple filters to your data at once.

1. Taking the data below for sales of different products as an example.

Data for the sale of goods.

2. Let’s filter out sales for Oranges where the Quantity sold was 5 or more.

3. This involves two filters: Oranges and Qty of 5 or more.

4. To apply the Advanced filter, copy and paste the relevant headers of your data to separate cells. Relevant headers in this case are “Products” and “Quantity”

Copy / Pasting headers

5. Under each header, mention the filter criteria as shown below.

Filtering criterion

Under the Product header, we have mentioned ‘Oranges’.

Under the Quantity header, we have mentioned the criterion “>=5”

6. Go to Data > Sort & Filter > Advanced.

Advanced filters

7. Against the List Range, select the data to be filtered.

8. Against the Criteria Range, select the formatted cells where the criterion is mentioned.

Advanced filters

9. Hit Okay. Excel filters the data to show sales of Oranges of 5 or more units only.

Advanced filter filters results.

Advanced filters allow you to apply many filters at the same time. It further allows you to filter data in its place or create a copy of filtered data to another destined place.

That’s it – Now what?

If you didn’t know about the filter tool of Excel yet, this guide is your savior.

We learned about filtering data based on text and numbers and colors in Excel using the Auto Filter tool. We also took a glance at the advanced filtering tool of Excel.

The filter and advanced filter tool of Excel will help you narrow down your data and pick out the relevant stats in an instant.

Especially, when used to assist other major functions like the VLOOKUP, SUMIF, and IF functions, it eases your Excel jobs by a thousand times.

Don’t know much about these functions? No worries.

Click here to sign up for my free 30-minute email course to help yourself learn these and many more amazing functions of Excel.

Other resources

If you enjoyed learning about AutoFilter and Advanced Filter in Excel, we bet you’d love to know more about the filter function and tools in Excel.

Check out our articles on data validation and creating data tables in Excel.

Kasper Langmann2023-01-19T12:15:20+00:00

Page load link

Filtering is a common everyday action for most Excel users. Whether using AutoFilter or a Table, it is a convenient way to view a subset of data quickly. Until the FILTER function in Excel was released, there was no easy way to achieve this with formulas. When Microsoft announced the changes to Excel’s calculation engine, they also introduced a host of new functions. One of those new functions is FILTER, which returns all the cells from a range that meet specific criteria.

At the time of writing, the FILTER function is only available in Excel 365, Excel 2021 and Excel Online. It will not be available in Excel 2019 or earlier versions.

Download the example file: Click the link below to download the example file used for this post:

Watch the video:

Watch the video on YouTube

Arguments of the FILTER function

Before we look at the arguments required for the FILTER function, let’s look at a basic example to appreciate what it does.

FILTER Function Basic Usage

Here the FILTER function returns all the values in cells B3-B10 where the number of characters is greater than 15. Not a scenario that many of us will need, but it perfectly demonstrates the power of the new FILTER function.

FILTER has three arguments:

=FILTER(array, include, [if_empty])
  • array: The range of cells, or array of values to filter.
  • include: An array of TRUE/FALSE results, where only the TRUE values are retained in the filter.
  • [if_empty]: The value to display if no rows are returned.

Examples of using the FILTER function

The following examples illustrate how to use the FILTER function.

Example 1 – FILTER returns an array of rows and columns

In this example, cell F3 contains a single formula, but this formula returns an array of values into the neighboring rows and columns.

FILTER Function retuns array of rows and columns

The formula in cell F3 is:

=FILTER(B3:D10,C3:C10>100)

This single formula is returning 2 rows and 3 columns of data where the values in C3-C10 are higher than 100.

Example 2 – #CALC! error caused by the FILTER function

The screenshot below displays what happens when the result of the FILTER function has zero results; we get the #CALC! error.

FILTER #CALC! Error

The formula in cell F3 is:

=FILTER(B3:D10,C3:C10>200)

As no rows meet the criteria of Invoice Value being higher than 200, the FILTER cannot return a value, so the #CALC! error is displayed.

Thankfully, Microsoft has given us the if_empty argument, which displays a message if there are no rows returned.

FILTER Function with if_empty argument

The formula in cell F3 is:

=FILTER(B3:D10,C3:C10>200,"No Results")

In the screenshot above, No Results displays instead of the #CALC! error.

If we wanted to display a result in each column, we could include a constant array within the if_empty argument. The following shows n/a in the Invoice Value and Days Due columns.

=FILTER(B3:D10,C3:C10>200,{"No Results","n/a","n/a"})

This formula would result in the following:

nction no results, multiple if_empty values

Example 3 – FILTER expands automatically when linked to a table

This example shows how the FILTER function responds when linked to an Excel table.

FILTER expands automatically with table

The FILTER is set to show items where Invoice Value is higher than 100. New records added to the Table which meet the criteria are automatically added to the spill range of the function. Amazing stuff!

Example 4 – Using FILTER with multiple criteria.

Example 4 shows how to apply FILTER with multiple criteria.

FILTER with multiple AND conditions

The formula in cell F3 is:

=FILTER(B3:D10,(C3:C10>50)*(D3:D10>30))

For anybody who has used the SUMPRODUCT function, this method of applying multiple conditions will be familiar. Multiplication creates AND logic (i.e., all the criteria must be TRUE). The example above shows where the Invoice Value is greater than 50 and the Days Due is greater than 30.

Addition creates OR logic (i.e., any individual condition can be TRUE).

FILTER with multiple OR conditions

The formula in cell G3 is:

=FILTER(B3:D10,(C3:C10>50)+(D3:D10>30))

The example above shows where the Invoice Value is greater than 50 or the Days Due is greater than 30.

Example 5 – Using FILTER for dependent dynamic drop-down lists

Drop-down lists are a data validation technique. Dependent drop-down lists are an advanced technique where the lists change depending on the result of another cell. For example, if the first drop-down list displays country names, the second drop-down list should only display cities that exist in that country. In Excel 2019 and before there are only tedious methods to achieve this effect, but the new FILTER function makes this super easy.

FILTER - Dependent drop-down lists

The formula in cell H3 is:

=UNIQUE(B3:B10)

The UNIQUE function creates a unique list to populate the drop-down in cell F4.

The formula in cell I3 is:

=FILTER(C3:C10,B3:B10=F4)

Depending on the value in cell F4, the values returned by the FILTER function change. The second drop-down in cell F6 changes dynamically based on the value in Cell F4.

Example 6 – Using FILTER with other functions

In this final example, FILTER is nested inside the SORT function.

FILTER and SORT together

The formula in cell F3 is:

=SORT(FILTER(B3:D10,D3:D10<=30))

First, the FILTER function returns the cells based on the Days Due being less than or equal to 30. The SORT function then puts the Customers into ascending alphabetical order.

Example 7 – Using FILTER to show matching items from a list

How can we match a list of items that could have an unknown size? We can’t keep updating our FILTER function by adding and removing criteria. And, if we had a lot of items to match, it would soon become unmanageable. So, let’s see how we can solve this.

In the example below, the formula in cell H3 returns only the customers listed in F3:F4.

FILTER Example 7 - Matching based on a list

The formula in cell H3 is:

=FILTER(B3:D10,COUNTIFS(F3:F4,B3:B10),"No results")

The COUNTIFS function returns a positive number if the item exists in both the data and the list, or zero if it exists in only one. Since positive numbers are always TRUE and zeros are always FALSE, this provides the TRUE/FALSE logic required for the FILTER function to return only the matching items.

NOTE: If the list starting in F3 were generated by another array formula, or by Power Query this solution would be completely dynamic (that is outside the scope of the current post, so we have used static ranges for this example).

Example 8 – Simulating wildcard search with FILTER

The FILTER function does not allow wildcard characters in the criteria. However, by using a combination of SEARCH and ISNUMBER we can simulate a similar effect.

In the example below, the formula in cell H3 returns only the items where the customer name contains the letters in cell F3.

Example 8 - FILTER with wildcards

The formula in cell H3 is:

=FILTER(B3:D10,ISNUMBER(SEARCH(F3,B3:B10)),"No results")

SEARCH returns a number if the search term in cell F3 is found in each value in B3-B10.

ISNUMBER returns TRUE or FALSE for each value depending on if SEARCH returns a number. This TRUE/FALSE value provides the logic needed by FILTER to return the matching items.

In this scenario only, Milkshake Junction and Sunset Satay contain un as a substring, therefore only these customers are returned.

Want to learn more?

There is a lot to learn about dynamic arrays and the new functions. Check out my other posts here to learn more:

  • Introduction to dynamic arrays – learn how the excel calculation engine has changed.
  • UNIQUE – to list the unique values in a range
  • SORT – to sort the values in a range
  • SORTBY – to sort values based on the order of other values
  • FILTER – to return only the values which meet specific criteria
  • SEQUENCE – to return a sequence of numbers
  • RANDARRAY – to return an array of random numbers
  • Using dynamic arrays with other Excel features – learn to use dynamic arrays with charts, PivotTables, pictures etc.
  • Advanced dynamic array formula techniques – learn the advanced techniques for managing dynamic arrays

Headshot Round

About the author

Hey, I’m Mark, and I run Excel Off The Grid.

My parents tell me that at the age of 7 I declared I was going to become a qualified accountant. I was either psychic or had no imagination, as that is exactly what happened. However, it wasn’t until I was 35 that my journey really began.

In 2015, I started a new job, for which I was regularly working after 10pm. As a result, I rarely saw my children during the week. So, I started searching for the secrets to automating Excel. I discovered that by building a small number of simple tools, I could combine them together in different ways to automate nearly all my regular tasks. This meant I could work less hours (and I got pay raises!). Today, I teach these techniques to other professionals in our training program so they too can spend less time at work (and more time with their children and doing the things they love).


Do you need help adapting this post to your needs?

I’m guessing the examples in this post don’t exactly match your situation. We all use Excel differently, so it’s impossible to write a post that will meet everybody’s needs. By taking the time to understand the techniques and principles in this post (and elsewhere on this site), you should be able to adapt it to your needs.

But, if you’re still struggling you should:

  1. Read other blogs, or watch YouTube videos on the same topic. You will benefit much more by discovering your own solutions.
  2. Ask the ‘Excel Ninja’ in your office. It’s amazing what things other people know.
  3. Ask a question in a forum like Mr Excel, or the Microsoft Answers Community. Remember, the people on these forums are generally giving their time for free. So take care to craft your question, make sure it’s clear and concise.  List all the things you’ve tried, and provide screenshots, code segments and example workbooks.
  4. Use Excel Rescue, who are my consultancy partner. They help by providing solutions to smaller Excel problems.

What next?
Don’t go yet, there is plenty more to learn on Excel Off The Grid.  Check out the latest posts:

Понравилась статья? Поделить с друзьями:
  • How to do excel formulas for if
  • How to edit documents in word
  • How to do excel conditional formatting
  • How to edit document in word
  • How to do distinct count in excel