Apply a filter in excel

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel for iPad Excel for iPhone Excel for Android tablets Excel for Android phones More…Less

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

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

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 («»).

FILTER function - Filter Region by Product (Apple)

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

=FILTER(array,include,[if_empty])

Argument

Description

array

Required

The array, or range to filter

include

Required

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

[if_empty]

Optional

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

Notes: 

  • 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),»»).

Using FILTER with the multiplication operator (*) to return all values in our array range (A5:D20) that have Apples AND are in the East region.

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)

Using FILTER 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.

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).

FILTER and SORT together - Filter by Product (Apple) OR by Region (East)

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.

See Also

RANDARRAY function

SEQUENCE function

SORT function

SORTBY function

UNIQUE function

#SPILL! errors in Excel

Dynamic arrays and spilled array behavior

Implicit intersection operator: @

Need more help?

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

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

The Excel Filter Feature is a great tool that proves to be a lifesaver at the time when you are working with huge data in Excel. In this blog, we would unlock this filter feature in Excel. We would learn how to filter huge data in excel. We would also get into answering the following common questions – how to filter values, or numbers, or dates and time in Excel, how to use filter using wildcard characters in excel, how to filter using the search box, how to filter by text or cell color.

Sample Data – Download Sample File

In this blog, we would be using the below data. Kindly download and practice along with using the Download button.

Table of Contents

  1. Sample Data – Download Sample File
  2. What is the Purpose of Filter Feature in Excel?
  3. Adding Filter Option on Header Rows
  4. Simple Ways to Filter Your Data Set in Excel
    1. Applying Filter on Single Column
    2. Applying Filter on Multiple Columns
  5. Filter Data Using Filter Search Box in Excel
  6. Clearing Filter on Columns in Excel
  7. How to Filter Values or Text in Excel?
    1. Filter Values based on Two Criteria
  8. How to Filter Numbers in Excel?
  9. How to Filter Dates in Excel?
  10. How to Filter By Color in Excel?
    1. Quick Way to Filter By A Specific Cell’s Value, Font Color, Cell Color or Icon
  11. A Solution To – AutoFilter Does Not Work After Changing Data
  12. Copy and Paste only Filtered Data in Excel
    1. Copy and Paste Filtered Data Including Header Row
    2. Copy and Paste Filtered Data Excluding Header Row
  13. Removing Filter From Headers in Excel
Sample Data - Filter Feature in Excel

What is the Purpose of Filter Feature in Excel?

The Filter Feature (also known as AutoFilter) is a powerful tool provided by Excel that narrows down the excel data or data in excel tables to show only those data that you want to see by temporarily hiding all other data. In our sample data, for example, we can use this feature to condense the data such that it only shows the programs taken up by the ‘Female‘ applicants.

In a similar way, you can filter by dates, or values or by any other such criteria.

The filters are always added to the headers of the data set. Therefore, it is important that your excel data must contain a header row, with logical headings. In our example, row 3 is the header row with headings describing the column data.

Header Row in Data Set

Once your dataset has proper headers, you are now good to insert the AutoFilter on these headers. To add AutoFilter on the header row, click on any of the cells inside the excel data set (like C7) and use any of the below-mentioned ways:

  • Go to ‘Home‘ tab > ‘Editing‘ Group > ‘Sort & Filter‘ Option > ‘Filter‘ button.
Filter Option under Home Tab
  • Go to ‘Data‘ tab > ‘Sort & Filter‘ group > ‘Filter‘ Button.
Filter Option under Data Tab
  • Keyboard Shortcut Method : Ctrl + Shift + L

As soon as you use any of the above methods, the excel would automatically detect the header row inside the table or data set and insert filter buttons on each of the header cells. These are the downward-facing arrows, like the way shown below:

Filter on Header Row

Simple Ways to Filter Your Data Set in Excel

Once the filter option added to the headers, you are good to start filtering your data set.

With this feature, you can filter your data by a single column or by multiple columns.

Applying Filter on Single Column

To apply the filter on a single column, simply click on the filter button (downward-facing arrow) of the respective column. (Let us firstly apply the filter on the column ‘Program Name’). As a result, you would notice that all the checkboxes are checked by default.

Filter Drop Down Initial View

Uncheck the checkbox that says ‘Select All‘. This would remove the check boxes from all the values.

Now, start ticking the values that you wish to view and click on ‘OK’, like the way demonstrated in the below image.

Filter by One Column Demonstration

Consequently, the excel would view or show only the selected values in the column, rest all are hidden. Don’t worry excel has not deleted them, they are still there in the backend.

Applying Filter on Multiple Columns

In a similar way, you can apply the filter on other columns in the Excel Data Table. There is no limitation on how many columns to which you can apply the filter.

Let us now apply another filter on the column having header – ‘Gender‘.

Filter by Multiple Columns

As a result, the excel would now only display the data set rows for selected ‘Program’ and for ‘Female’ candidates. All others are temporarily hidden (not removed).

Filter Multiple Columns Result

Some Useful Points and Tips

Once a filter is applied on the header row-

  • The Downward-facing arrow on the filtered column changes its icon which denotes that there is a filter applied to this column.
  • When you take your mouse cursor over the filter button, it shows the filter values.
Hovering Mouse Cursor on Filter Button
  • To increase or decrease the width of the filter window, take your mouse cursor on the bottom-right corner of the filter window. Once the mouse cursor changes to a two-side facing arrow, click and drag right (to increase) or left (to decrease). See the below demonstration for more clarity.
Increase Decrease Width of Filter Window

Filter Data Using Filter Search Box in Excel

In the earlier section, we learned about how to filter your data set by selecting the checkboxes in the Filter window. There is yet another way to filter out a specific text or value or numbers or dates/time in Excel which is by using the ‘Filter’ search box. The Filter search box is placed just above the list of values in the Filter window.

To filter your data set using the ‘Filter’ search box, simply click on the ‘Filter’ drop-down icon on the header and type the search value in the search box. As a result, the excel would narrow down the list to show only the specified values. Finally, click on the ‘OK’ button to apply the filter.

To illustrate with an example, let us filter out the ‘Program’ column with the Bachelor’s degree.

Filter Using Search Box

Not sure about the exact text to search, then use wildcard characters in the search box for a non-exact filter search in Excel. If you are unaware of what are wildcard characters in Excel and its usage, then please click here.

Clearing Filter on Columns in Excel

When you want to clear filter from selected or all the header columns in Excel, you can use any of the below-mentioned ways:

  • Click on the ‘Filter‘ icon on the header of the column header, and click on the option that says – Clear Filter from <Column Header Name>
Clear Filter from Column Header
  • Another way is to click on the ‘Filter‘ icon of the header, and check the checkbox – ‘Select All‘.
Clear Filter from Column Header #2

When you clear the filter from the column ‘Gender’, the data set would now only have a filter on the column header ‘Program’. It has only cleared filter from the row ‘Gender’ and has not touched any other filters.

To clear multiple filter from all the headers cells, use any of the following way:

  • Click on any of the cells in the dataset and navigate to the path – Data tab > Sort & Filter Group and there click on the option that says – Clear.
Clear Filter From All Headers #1
  • Or you can even use this – Home Tab > Editing Group. Click the option Sort & Filter > Clear.
Clear Filter From All Headers #2

It is important to note that the above method only clears the filter from the header cell. It does not remove the filter icon from the header row. To learn how to remove the filter in Excel, wait until the end of this blog.

How to Filter Values or Text in Excel?

When you are working with text filters, there are many other text filter options available in addition to what we learned above. Below is the list of the same.

  • You can filter the values or text which exactly Equals or which Does Not Equal to some text.
  • Additionally, you can even filter for a non-exact match by using the Contains and Does Not Contain a text
  • Or, you can even filter the values or text that starts or Begins With or Ends With a particular text.

These advanced filter options are available under the ‘Text Filter’ section of the Filter Window as shown in the image below:

Text Filter Options #1

Let us understand this with the help of a small example: Let us, for example, get the program that contains the word ‘Business’ in it. To achieve it,

Click on the ‘Filter‘ icon on the column header – ‘Program’, and take your mouse cursor to the option – Text Filters.

In the list of options that come up, select the option that says – ‘Contains‘. As a result, the ‘Custom AutoFilter‘ dialog box would appear on your screen. In the input box besides the word ‘Contains’, write the text that you want to filter (in our case ‘Business’) and press OK.

Custom AutoFilter dialog box #1

As soon as you press OK, excel would show all the values or text that contains the word ‘Business’ and will hide all other data rows.

Note that, just like Filter search box, this ‘Custom AutoFilter’ dialog box also accepts wildcard character search.

Filter Values based on Two Criteria

The Custom AutoFilter dialog box also allows us to filter out the data rows based on two criteria. Use the And and Or operator radio buttons based on how you wish to filter.

For example: Let us filter out all the programs for Commerce and Science. In this case, as we want both the values, we shall use Or operator, like this-

Custom AutoFilter - Two Criteria Filtering

This would filter out those values which either contain the word ‘Commerceor contain the word ‘Science‘.

How to Filter Numbers in Excel?

Similar to the text filter learned above, there are many additional filter options available carry Number Filters in Excel. Below is the list of the same:

  • You can filter the exact number or amount by using Equals and Does Not Equal option under the ‘Number Filter’.
  • Similarly, the Number Filter – Greater Than and Less Than allows us to get all values that are more or less than a specific value.
  • Greater Than or Equal To and Less Than or Equal To works in a similar way.
  • Between Number Filter allows you to filter out the values lies between two values (lower and upper values both inclusive)
  • Other options are – Top 10, Above Average, Below Average
Number Filter Option #1

The filter option Top 10 does not exactly only mean Top 10 values. You can change it to any other value like Top 15, or Top 27 Values, and even Bottom 5 values and so on.

Top 10 AutoFilter Dialog Box

Filter Feature in Excel

How to Filter Dates in Excel?

Unlike the Text and Number Filter, the Dates Filters option allows us with more advanced filtering options. The below image in itself is self-explanatory.

Date Filter #1

In a nutshell, below options are available for filtering dates in Excel –

  • You can filter the dates which fall in the current month/week/quarter/year and even for previous and upcoming (i.e. next) month/week/quarter/year.
  • Additionally, you can filter out by an exact date, or date that falls before or after a particular date, or between two dates.
  • Excel provides with an option to filter all the dates in a particular month or quarter (regardless of the year in which it falls)
  • You can create a custom date filter using the ‘Custom AutoFilter’ dialog box to which you are already aware of using.

Important to notice – Excel by default groups all the dates by year, months, and then the days. You can expand or collapse the groups (year, months, and days) to filter the dates and check/uncheck it to filter accordingly.

Date Filter #2

In the above image, you can see that all the dates are grouped by years first (2020 and 2019). Within the years there are months and then the days in the month. If you clear the checkbox for 2020, then the excel would only show the dates that lie in 2019.

How to Filter By Color in Excel?

When the data set contains any text with color or any cell with a background color, you can use the ‘Filter by Color‘ option in the ‘Filter’ Window to filter the dataset by a specific text or cell background color.

Let me explain this with a small example. I am changing the background color of different cells to yellow, orange, and green. Also, I have the font color in a few of the cells as ‘Red’.

To filter the values based on color, simply click on the ‘Filter’ drop-down arrow button on the header cell and take your mouse cursor over the option that says – ‘Filter by Color’.

As a result, you would see that excel lists all the cell and font color. You can choose the color that you want to filter with.

Filter by Color

Let us, for example, filter the programs by Red font color. The result of the filter would be as below.

Filter By Font Color - Illustration

Quick Way to Filter By A Specific Cell’s Value, Font Color, Cell Color or Icon

Instead of using the ‘Filter’ drop-down icon to filter, you can even filter the dataset based on a specific cell’s value, icon, or font and cell color. To do so, follow the undermentioned steps:

  • Right-click on the cell that contains the color by which you want to filter. Let us, in this case, filter by yellow color. Therefore, I have right-clicked on C4 (as it has a yellow cell color).
  • Take your mouse cursor to the option that says – ‘Filter‘, and click on the option – ‘Filter by Selected Cell’s Color‘.

As a result, excel would filter the dataset based on the cell color – Yellow, as demonstrated in the below image:

Filter By Selected Cell's Color - Illustration

A Solution To AutoFilter Does Not Work After Changing Data

When you make any changes in the filtered data, you would notice that excel does not refresh the filter automatically. Yes, that is absolutely true. You need to reapply the filter in order to refresh the data and apply the filter on the changed data. There are a couple of ways to do the same, as listed below:

  • Using Filter Window – After making changes in the filtered data, simply click on the ‘Filter’ drop-down arrow on the header cell and click ‘OK’ in there. However, there is are exceptions to this method. This would not work when you apply ‘filter by color’ or ‘Number Filter/Text Filter/Date Filter’. This technique only applies when you use the search box to filter out the data.
Reapply Filter #1
  • Using Reapply Option – After making changes in the filtered data, simply navigate to the Data tab > Sort & Filter Group > Reapply Option. The keyboard shortcut key for the same is Ctrl + Alt + L.
Reapply Filter #2

This option is also available in the Home Tab > Editing Group > Sort & Filter Option > Reapply.

Reapply Filter #3

Copy and Paste only Filtered Data in Excel

There are two possibilities to copy and paste only filtered data in Excel.

Copy and Paste Filtered Data Including Header Row

Simply, click on any of the cell in the filtered area, and press Ctrl + A to select the entire excel table or data set. As a result, you would notice that excel selects the entire table including both data rows as well as the header row. Now, press Ctrl + C to copy the selection and use Ctrl + V at the destination location to paste the filtered data cells.

Copy and Paste Filtered Data Excluding Header Row

To copy and paste only filtered data (without header row), select the top-left cell of the data (which in our case it is C4). Press keyboard keys Ctrl + Shift + Down_Arrow and then press Ctrl + Shift + Right_Arrow (instead you can even use Ctrl + Shift + End). Any of these ways would select the entire data set (excluding headers). Now, use Ctrl + C to copy the selection and then Ctrl + V to paste the filtered data set at the destination cell.

Usually, when you copy the filtered dataset using the above methods, excel does not include the hidden rows in the copy area. The hidden rows are excluded and it only takes the visible rows while copying. However, sometimes when your data is huge, it may not work in expected behavior. In those cases, to play safe, you can use the GoTo (F5) > Special > Visible Cells Only feature to select only the visible rows. The keyboard shortcut for the same is Alt + ; (semi-colon).

Finally, let us now learn how to remove filters from the excel header row. There are multiple ways using which you can remove filters, as listed below-

  • The easiest way is to use the keyboard shortcut – Ctrl + Shift + L.
  • Another way is to use ribbon path – Data Tab > Sort & Filter Group > Filter option OR Home Tab > Editing Group > Sort & Filter Option > Filter Option.

RELATED POSTS

  • How to Make A Table In Excel – A Hidden Functionality

  • How to Sort a Table or Data in Excel

  • Text and Number Filter in Pivot Table in Excel

  • Group and Ungroup Rows in Excel

  • FILTER Function in Excel – Dynamic Filtered Range

  • Applications – FILTER Function in Excel

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])…

A lesson that teaches how to use the Microsoft Excel FILTER function- by SpreadsheetClass.com

The FILTER function in Excel is a very useful and frequently used function, that you will likely find the need for in many situations. Note that the FILTER function is only available in Microsoft Office 365, and Microsoft Office Online.

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

  1. Type =FILTER( to begin your filter formula
  2. Type the address for the range of cells that contains the data that you want to filter, such as B1:C50
  3. Type a comma, and then type the condition for the filter, such as C3:C50>3 (To set a condition, first type the address of the «criteria column» such as B1:B, then type an operator symbol such as greater than (>), and then type the criteria, such as the number 3.
  4. Type a closing parenthesis and then press enter on the keyboard. Your entire formula will look like this: =FILTER(B1:C50,C1:C50>3)

In this article I will start with the basics of using the FILTER function (examples included), and then also show you some more involved ways of using the FILTER function. This article focuses specifically on the FILTER function that is typed into the spreadsheet cells as a formula, and not the filter command available from the toolbar and pop-up menus.

Using the FILTER function in Excel is almost the same as using it in Google Sheets, but there are slight differences between the two. Click here to read the Google Sheets version of this article

Here are the Excel Filters formulas:

Filter by a number

  • =FILTER(A3:B12, B3:B12>0.7)

Filter by a cell value

  • =FILTER(A3:B12, B3:B12<F1)

Filter by a text string

  • =FILTER(A3:B12, B3:B12=»Late»)

Filter where NOT equal to

  • =FILTER(A3:E1000, B3:B1000<>»Bob»)

Filter by date

  • =FILTER(A3:C12,C3:C12<G1)   (Date entered in cell G1)
  • =FILTER(A3:C12,C3:C12<DATE(2019,6,1))

Filter by multiple conditions

  • =FILTER(A3:C12,(B3:B12=»Late»)*(C3:C12=»Active»))   (AND logic)
  • =FILTER(A3:C12, (B3:B12=»Late»)+(C3:C12=»Active»))   (OR logic)

Filter from another sheet

  • =FILTER(‘Sheet Name’!A3:B12,’Sheet Name’!B3:B12=»Full Time»)

=FILTER(A3:B12, B3:B12=F1)

(Copy/Paste the formula above into your sheet and modify as needed)

A diagram and detailed formula breakdown for the Microsoft Excel FILTER function

The FILTER function in Excel allows you to filter a range of data by a specified condition, so that a new set of data will be displayed which only shows the rows/columns from the original data set that meets the criteria/condition set in the formula.

Excel description for FILTER function:

Syntax:
=FILTER(array,include,[if_empty])

Formula summary: “The FILTER function filters an array based on a Boolean (True/False) array.”

array (Required): The array, or range to filter

include (Required): A Boolean array whose height or width is the same as the array

[if_empty] (Optional): The value to return if all values in the included array are empty (filter returns nothing)

The source range that you want to filter, can be a single column or multiple columns.

The range that is used to check against the criteria that you set, must be a single column (later I will show you how to filter by multiple conditions, but don’t worry about that for now).

The criteria that set in the condition can be manually typed into the formula as a number or text, or it can also be a cell reference.

*Note that the source range and the single column range for the condition, must be the same size (must contain the same number of rows), or the cell will display an error.

Filtering by a single condition in Excel

First let’s go over using the FILTER function in Excel in its simplest form, with a single condition/criteria.

I will show you how to filter by a number, a cell value, a text string, a date… and I will also show you how to use varying «operators» (Less than, Equal to, etc…) in the filter condition.

Part 1: How to filter by a number

In this first example on how to use the filter function in Excel, the scenario is that we have a list of students and their grades, and that we want to make a filtered list of only students who have a perfect grade.

The task: Show a list of students and their scores, but only those that have a perfect grade

The logic: Filter the range A3:B12, where the column B3:B12 is greater than 0.7 (70%)

The formula: The formula below, is entered in the blue cell (D3), for this example

=FILTER(A3:B12, B3:B12>0.7)

An example of filtering by a number in Excel by using the FILTER function

Operators that can be used in the FILTER function:

In this example we are using the operator «=» (Equal To) for the filter condition/criteria, but you can also use any of the following:

«=» (Equals)
«>» (Greater than)
«<» (Less than)
«<>» (Not equal to)
«>=» (Greater than or equal to)
«<=» (Less than or equal to)

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

In this example, we want to achieve the same goal as discussed above, but rather than typing the condition that we want to filter by directly into the formula, we are using a cell reference.

When you filter by a cell value in Excel, your sheet will be setup so that you can change the value in the cell at any time, which will automatically update the value that the filter criteria it attached to.

In this example, you will notice that instead of directly typing the number “0.9” into the formula itself, the filter criteria is set as cell G1, where the “0.9” value is entered.

The task: Show a list of students and their scores, but only those that have a score below 90%

The logic: Filter the range A3:B12, where B3:B12 is less than the value that is entered in the cell F1 (0.9)

The formula: The formula below, is entered in the blue cell (D3), for this example

=FILTER(A3:B12, B3:B12<F1)

An example of filtering based on a cell value in Excel by using the FILTER function

Part 3: How to filter by text in Excel

In this example, we are going to use a text string as the criteria for the filter formula. This is very similar to using a number, except that you must put the text that you want to filter by inside of quotation marks.

In this scenario we are filtering a list that shows customers and their payment status, and we want to display only customers that have a payment status of “Late”.

The task: Show a list of customers who are past due on their payments

The logic: Filter the range A3:B12, where B3:B12 equals the text, “Late”

The formula: The formula below, is entered in the blue cell (D3), for this example

=FILTER(A3:B12, B3:B12=»Late»)

Example of filtering by text string in Excel, by using the FILTER function

Part 4: Using NOT EQUAL TO in the Excel FILTER function

Now that you have got a basic understanding of how to use the filter function in Excel, here is another example of filtering by a string of text, but in this example we will use the «not equal» operator (<>), so that you can learn how to filter a range and output data that is NOT equal to criteria that you specify.

In this example we will also use a larger data set to demonstrate a more extensive application of the FILTER function in the real world.

You may be surprised at how often a situation comes up when you need to filter data where it is “not equal to” a certain number or piece of text that you specify.

In this example let’s say that we have a report/spreadsheet that shows data from sales calls that occur at your company, and we want to filter the data so that a specified sales rep (Bob) is NOT included in the filter output.

The task: Show sales call data for all sales reps, except Bob

The logic: Filter the range A2:E1000, where B2:B1000 DOES NOT equal the text, “Bob”

The formula: The formula below, is entered in the blue cell (G3), for this example

=FILTER(A3:E1000, B3:B1000<>»Bob»)

An example of filtering where not equal to in Excel, by using the FILTER function

Notice that the filtered data on the right side of the image above does not contain any of the rows/calls that Bob was involved in.

Part 4: How to filter by date in Excel

Filtering by a date in Excel can be done in a couple of ways, which I will show you below. If you try to type a date into the FILTER function like you normally would type into a cell… the formula will not work correctly.

So you can either type the date that you want to filter by into a cell, and then use that cell as a reference in your formula… or you can use the DATE function.

When filtering by date you can use the same operators (>, <, =, etc…) as in other FILTER function applications. In Excel each different day/date is simply a number that is put into a special visual format. For example, in Excel, the date «06/01/2019» is simply the number «43,617», but displayed in date format. When you add one day to the date, this number increments by one each time… i.e «43,618»   «43,619»   «43,620»

So, one date can be considered to be «greater than» another date, if it is further in the future. Conversely, one date can be said to be «less than» another date, if it is further in the past.

In this first example we will filter by a date by using a cell reference. This is similar to the example we went over in part 2, but in this example instead of working with percentages, we are dealing with dates.

Let’s say that we want to filter a list of students, their test scores, and the dates that the tests were completed… and we want to show only tests that were taken before June (06/01/2019).

Filter by date in Excel example 1:

The task: Show only tests that were taken before June

The logic: Filter the range A3:C12, where C3:C12 is less than the date that is entered in cell G1 (06/01/2019)

The formula: The formula below, is entered in the blue cell (E3), for this example

=FILTER(A3:C12,C3:C12<G1)

An example of filtering by a date in Excel by using a cell reference with the FILTER function- Basic example

Filter by date in Excel example 2:

In this second example on filtering by date in Excel we are using the same data as above, and trying to achieve the same results… but instead of using a cell reference, we will use the DATE function so that you can type enter the date directly into the FILTER function.

When using the DATE function to designate a certain date, you must first enter the year, then the month, and then the day… each separated by commas (shown below).

The task: Show only tests that were taken before June

The logic: Filter the range A3:C12, where C3:C12 is less than the date of (06/01/2019)

The formula: The formula below, is entered in the blue cell (E3), for this example

=FILTER(A3:C12,C3:C12<DATE(2019,6,1))

An example of filtering by date in Excel by using the DATE function with the FILTER function- Basic example (Lesson by SpreadsheetClass.com)

Filter by multiple conditions in Excel

When using the Excel FILTER function you may want to output a set of data that meets more than just one criteria. I will show you two ways to filter by multiple conditions in Excel, depending on the situation that you are in, and depending on how you want to formula to operate.

The normal way of adding another condition to your filter function, (as shown by the formula syntax in Excel), will allow you to set a second condition, where the first AND second condition must be met to be returned in filter output.

However I will also show you how to make a slight modification to the function so that you can choose to set a second condition where EITHER condition can be met to return/display in the filter function’s output/destination. (Separate the conditions with an asterisk to use AND logic, or separate the conditions with a plus sign to use AND logic.)

Part 5: Filtering by 2 conditions where BOTH MUST BE TRUE

In this example, we are going to filter a set of data, and only display rows where BOTH the first condition AND the second condition are met/true.

To use a second condition in this way (with AND logic), simply enter the second condition into the formula after the first condition, separated by an asterisk (*). Each condition must be inside of its own set of parenthesis (shown below).

When using the filter formula with multiple conditions like this, the columns that are referenced in each condition must be different.

In this scenario we want to filter a list that shows customers, their payment status, and their membership status… and to show only customers who have an active membership AND who are also late on their payment.

This will make sure that customers with an inactive membership who are still designated as being late on payment in the system… are not shown in the filter results, and not put on the list for being sent a «late payment» notice.

The task: Show a list of customers who are late on their payments, but only those with active memberships

The logic: Filter the range A3:C12, where B3:B12 equals the text “Late”, AND where C3:C12 equals the text “Active”

The formula: The formula below, is entered in the blue cell (E3), for this example

=FILTER(A3:C12,(B3:B12=»Late»)*(C3:C12=»Active»))

Example of filtering by multiple conditions in Excel by using the FILTER function- Basic example (AND Logic)

Part 6: Filtering by 2 conditions where EITHER ARE TRUE, not necessarily both

In this example we are going to filter a set of data and only display rows where EITHER the first condition OR the second condition are met/true.

To use a second condition in this way (with OR logic), simply enter the second condition into the formula after the first condition, separated by a plus sign. Each condition must be inside of its own set of parenthesis (shown below).

When using the FILTER formula in this way, you can choose criteria from the same or different columns.

In this scenario we want to filter the same customer data as shown in the previous example, but this time we want to show a list of customers who EITHER have an active membership OR who are late on their payment. This will give a list of customers who can be sent a notice for payment… including active members, or/also inactive members who are late on their final payment.

The task: Show a list of customers who are active members, and include customers who are late on payment even if they are not active members

The logic: Filter the range A3:C12, where B3:B12 equals the text “Late”, OR where C3:C12 equals the text “Active”

The formula: The formula below, is entered in the blue cell (E3), for this example

=FILTER(A3:C12, (B3:B12=»Late»)+(C3:C12=»Active»))

An example of filtering by multiple conditions in Excel by using the FILTER function- Basic example (OR Logic)

How to filter from another sheet in Excel

You may often find situations where you need to filter from another sheet in Excel, where your raw unfiltered data is on one tab, and your filter formula / filter output is on another tab.

This can be done by simply referring to a certain tab name when specifying the ranges in the filter. So where you would normally set a range like «A3:B», when referencing another sheet while filtering you specify the tab name by adding the tab name and an exclamation mark before the column/row portion of the range, like «TabName!A3:B»

However when the tab name has a space in it, it is necessary to use an apostrophe before and after the tab name, like ‘Tab Name’!A3:B.

Here is an example of how to filter data from another tab in Excel, where your filter formula will be on a different tab than the source range.

Let’s say that you have a list of employees and their schedule type (Full Time / Part Time) on one tab, and that you want to display a filtered list of full time employees on another tab.

The task: Filter the list of employees on the tab labeled «Filter List», and show a list of employees who have a full time schedule, on a separate tab

The logic: Filter the range ‘Filter List’!A3:B12, where the range ‘Filter List’!B3:B12 is equal to the text «Full Time»

The formula: The formula below, is entered in the blue cell (A3), for this example

=FILTER(‘Filter List’!A3:B12,’Filter List’!B3:B12=»Full Time»)

Here is a list of employees and their schedules, which is held on a tab labeled «Filter List»

An example of filtering from another sheet in Excel- Raw data list tab

And here is a filtered list of employees who have full time schedules, where the filter formula and output data are held on a separate tab.

Example of filtering from another sheet in Excel by using the FILTER function- Filter formula tab

Pop Quiz: Test your knowledge

Answer the questions below about the Excel FILTER function, to refine your knowledge! Scroll to the very bottom to find the answers to the quiz.

Question #1

Which of the following formulas uses a «cell reference» in the filter condition?

  1. =FILTER(A1:D15, B1:B15<0.6)
  2. =FILTER(A2:C15, C2:C15=F1)
  3. =FILTER(A1:P25, G1:G25=»Yes»)

Question #2

Which of the following formulas uses the «Not Equal» operator?

  1. =FILTER(C1:T50, J1:J50>100)
  2. =FILTER(A1:B75, B1:B75=»No»)
  3. =FILTER(S1:Z100, T1:T100<>»True»)

Question #3

True or False: If the column(s) in the source range and the column in the filter condition are not the same size (if one has more rows than the other), the formula will not work, and will display an error.

  1. True
  2. False

Question #4

Which of the following formulas uses AND logic, where BOTH conditions must be met to satisfy the filter criteria?

  1. =FILTER(C1:F20, (F1:F20=»Yes»)+(E1:E20=»Active»))
  2. =FILTER(C1:F35, (F1:F35=»Yes»)*(E1:E35=»Active»))

Question #5

Which of the following formulas uses OR logic, where EITHER condition can be met to satisfy the filter criteria?

  1. =FILTER(A1:K10, (K1:K10=»Yes»)*(J1:J10=»Active»))
  2. =FILTER(A3:K33, (K3:K33=»Yes»)+(J3:J33=»Active»))

Answers to the questions above:

Question 1:   2

Question 2:   3

Question 3:   1

Question 4:   2

Question 5:   2

Понравилась статья? Поделить с друзьями:
  • Application vnd openxmlformats officedocument word
  • Application vnd ms excel что это
  • Application vnd ms excel xml
  • Application vnd ms excel xls
  • Application vnd ms excel sheet macroenabled 12