Guide to How to Add, Use and Remove Filter in Excel

Method 1 – Add Filter in Excel Using Home Tab

  • Select a random cell in the range or the whole range => navigate to the Home tab => Editing group => Sort & Filter drop-down => select Filter.

Filter option from Home tab

  • It’ll add the filter button to the headers of the columns.

Add Filter in Excel


Method 2 – Insert Filter from Data Tab

  • Select the range of cells in the Department column => navigate to the Data tab => and click the Filter icon to add a Filter to the headers.

Filter added from Data tab


Method 3 – Applying Keyboard Shortcut to Add Filter

Provides a way to enable the Filter with keyboard shortcut. Select a cell in the range and press CTRL+SHIFT+L. Excel will add a Filter button to every column in the range.

Filter added from keyboard shortcut

Note: If you want to apply multiple filters in Excel to the whole range of your data, select a random cell or the whole range, but when you need to add a Filter to a specific column, just select the cells in that specific column.

After enabling this feature, you can filter data based on cell value in Excel. We can filter Manager from the Designation column following the GIF below.

Filter data based on cell value


How to Filter Data in Excel

You can filter data in Excel with the Filter feature according to your needs. For this purpose, Excel provides a number of ways:
– filter by text
– filter by number
– filter by date
– filter by search or partial match
– filter by cell color or text color


1. Filter by Text

For the dataset we have used previously, we want to filter data from the IT department. We will use the Text Filter.

  • Click on the drop-down arrow in the Department column.

Click on Filter button

  • Click Text Filters => select Equals.

Equals condition for Text Filters

  • This command launches the Custom Autofilter dialog box.
  • To filter data by the text “IT”, type IT beside the equals field => click OK.

Custom Autofilter dialog box to show IT rows only

  • Excel makes only the relevant data visible to the IT department.

Text Filter applied for IT


2. Filter by Number

  • Click the dropdown in the Annual Salary column.

Click on drop-down of Annual Salary column

  • From the dropdown options, select Number Filers => click Greater Than Or Equal to.

Number Filters for greater than or equal to

  • In the Custom Autofilter dialog box, type 500000 right beside the is greater than or equal field => and click OK.

Custom Autofilter dialog box

  • This only filters the information of the employees about the given condition.

Filtered with number


3. Filter by Date

Our dataset includes the Hire Date of the employees. We want to extract the information of the employees whose Hire Date is between 1 March 2023 and 31 March 2023.

  • Click the dropdown in the Hire Date column.

Click Hire date column to filter by date

  • Click Date Filters and it will show a range of filter options for date => select Between. You can also select Custom Filter to use a custom date filter in Excel. Both of these commands will launch the Custom Autofilter dialog box.

Date Filter options

  • In the is after or equal to field, type 1-Mar-23, and in the is before or equal to field, type 31-Mar-23 => click OK.

Custom Autofilter dialog box

See! Excel has extracted only the data for the month of March.

Hire date column filtered by date


4. Filter Data by Search or Partial Match

  • Click the drop-down in the Designation column.

Click drop-down of Designation column

  • In the search bar of the menu, type “Co” => click OK.

Type to filter by search or partial match

  • Match the relevant data whose first two letters start with “Co” which means “Coordinator” and show that data only.

Filtered with search


5. Filter Data by Color

Color filter in Excel allows you to filter your data by color. You can filter your data
– Using cell color
– Using text color


5.1. Filter by Cell Color

In the Annual Salary column of our dataset, we can see 3 colors in that cell range: green, yellow, and red. We want to filter data based on which cell color is green.

  • Click on the filter button in the Annual Salary column.

Click dropdown of Annual Salary column

  • Select the Filter by Color option in the menu bar => choose the Green color to filter by cell color.

Choose a color to filter by cell color

  • Excel is only showing the filtered cells with the green color.

Filtered with cell color


5.2. Filter by Text Color

The Annual Salary column includes three text colors: green, blue, and red. We will choose green to filter by text color.

  • Click on the Filter button in the Annual Salary column.

Click dropdown to filter by text color

  • Select the Filter by Color option in the menu bar => choose Red color to filter by text color.

Filter by font color

  • Excel has filtered the data that only contain texts with red color.

Filter by text color in Excel


How to Apply Filter in Multiple Columns to Extract Data

  • Click the dropdown in the Department column.

Click dropdown of Department column

  • Select IT from the filter options => click OK.

Select only IT from filter options

  • The Department column will only show the cell values with IT.
  • Click the drop-down in the Designation column.

Department column filtered with IT

  • Select Manager => click OK.

Select Manager from Designation dropdown

Excel will show only the information of the Manager from the IT department.

Filter data from Department and Designation columns


How to Filter Blank Cells in Excel

  • Click the dropdown of the Resign Date column.

Blank cells in Excel

  • From the dropdown options, keep the Blanks option selected only => click OK.

Filter only blank cells

  • Excel is showing the rows with blank cells only and all the other rows are filtered out.

Rows only with blanks are filtered


How to Use FILTER Function to Filter Data in Excel

1. Filter Data Dynamically

  • Select cell B17 => go to the Data tab => Data Tools group => select the Data Validation feature.

Data Validation feature

  • This launches the Data Validation dialog box. In the Settings tab, choose List in the Allow field.
  • In the Source field, select the list range or type:
=$B$6:$D$6
  • Click OK.

Data Validation to add drop down list

  • See a drop-down list.

Choose department from dropdown list

  • Choose Marketing from the drop-down options.
  • Select cell C16 => insert the following formula:
=FILTER(B7:D13,B16= B6:D6) & ""
  • Press ENTER. It will return all the employees of the selected department to cell B16.

FILTER function to extract data dynamically

  • Selecting a different value from the drop-down option in cell B16 will also change the output of the FILTER function in cell C16.

Filter data dynamically by choosing from dropdown list


2. Filter Duplicate Values

  • Select cell F7 => type the formula below.
=FILTER(B7:D21,COUNTIFS(C7:C21,C7:C21,D7:D21,D7:D21)>1,"Duplicates not found")
  • Press ENTER. You will get the duplicates that occurred in the Department and Designation column. If no duplicates were found, the formula would return “Duplicates not found”.

FILTER and COUNTIFS to find duplicates


How to Use Advanced Filter in Excel

1. Find Unique Values in Worksheet

Let’s use the Excel Advanced Filter for unique records only. Our dataset has some duplicate values. From there, we will find only rows with unique records with the Advanced Filter.

  • Select a random cell in the range => go to the Data tab => click Advanced. It will launch the Advanced Filter dialog box.

Advanced Filter feature

  • Keep Copy to another location marked.
  • Fill the List range field by selecting your data range $B$6:$F$17.
  • To fill in the Copy to field, select $B$19 in the worksheet where you want to copy the result.
  • Put a checkmark on the Unique records only field.
  • Click OK.

Advanced Filter for unique records only

You can see that Advanced Filter has extracted the unique records.

Unique records extracted from main data


2. Advanced Filter with Wildcard Character to Extract Value

Contains employee names where several people have common surnames. We will use “*Alvarado” to get all the information about employees whose surname is “Alvarado”.

  • Select a random cell in the range => go to the Data tab => and click Advanced to launch the Advanced Filter dialog box.

Apply Advanced Filter

  • Keep Copy to another location marked.
  • Fill the List range field by selecting your data range $B$6:$F$17.
  • Set the criteria range B$19:$B$20.
  • To fill in the Copy to field, select $B$22 in the worksheet where you want to copy the result.
  • Click OK.

Advanced filter for wildcard characters

Excel has extracted the employee name, titled Alvarado.

Surnames with Alvarado are extracted


3. Advanced Filter with Multiple Criteria

  • Select a cell => go to the Data tab => and click Advanced to launch the Advanced Filter dialog box.

Advanced filter with multiple criteria

  • Keep Copy to another location marked.
  • Fill the List range field by selecting your data range $B$6:$F$17.
  • Set the criteria range B$20:$C$21.
  • To fill in the Copy to field, select $B$23 in the worksheet where you want to copy the result.
  • Click OK.

Advanced filter for IT and Manager criteria

Excel will extract the data of “Manager” from “IT” department.

Filter records for multiple criteria


4. Advanced Filter to Exclude Blank Cells

We can also use the Excel Advanced Filter to exclude blank cells. Our dataset includes some blank cells, from which we want to exclude the rows with blanks.

Data with blank cells

  • Insert the formula below in cell G8.
=D7<>"".
  • Press ENTER. It’ll return TRUE, indicating that the value in cell D7 is not an empty string.

Formula returned TRUE for blanks

  • Launch the Advanced Filter dialog box from the Data tab.
  • Keep Copy to another location marked.
  • Fill the List range field by selecting your data range $B$6:$E$18.
  • Set the criteria range G$7:$G$8.
  • To fill in the Copy to field, select $B$20 in the worksheet where you want to copy the result.
  • Click OK.

Advanced Filter dialog box to exclude blank cells

You will get the result without the blank cells.

Filtered data excluding blank cells


How to Filter by Selected Icon or Format

  • Select cell F7 formatted with the green arrow => right-click to bring up the context menu.
  • Select Filter => click Filter by Selected Cell’s Icon.

Filter with selected cell's icon

  • Excel will filter your data according to the format you selected in the first step.

Annual Salary column filtered with green arrow


How to Use Filter in Protected Excel Sheet

Excel allows you to use Filter in a protected Excel sheet.

For the dataset below, we have enabled Filter in the Department and Designation columns. We will use this filter on a protected worksheet.

Department and Designation columns with Filter button

  • To protect the worksheet, go to the Review tab => and click Protect Sheet to launch the Protect Sheet dialog box.

Protect Sheet from Review tab

  • Keep the Protect worksheet and contents of locked cells marked.
  • Mark Use AutoFilter option only => click OK.

Mark Use AutoFilter in Protect Sheet dialog box

Your worksheet is now protected. You won’t be able to select any cells. But you have access to the Filter button.

  • Click the drop-down in the Department column.

Excel allows clicking Filter button in protected sheet

  • Select IT => click OK.

Filter by IT in protected Excel sheet

Although you can’t select or edit any cell, Excel allows you to filter data in a protected sheet in this way.

Filtered data in protected Excel sheet

You can also filter the Designation column similarly. But you won’t be able to filter other columns.


How to Filter Data in Excel Pivot Table

Create a Pivot Table with this data and then filter the data in that Pivot Table.

  • Select any cell in the range => go to the Insert tab => select PivotTable.

Insert PivotTable

  • The PivotTable from table or range dialog box will appear. Choose New Worksheet to place the PivotTable => click OK.

PivotTable form table or range dialog box

Excel will take you to a new worksheet. The PivotTable Fields pane will appear on the right side of that new worksheet.

  • Insert the parameters in the following field:

Filters: States
Rows: Product
Values: Quantity and Sales

PivotTable Fields

Excel will create the Pivot Table.

  • Select a cell in the PivotTable => go to the PivotTable Analyze tab => and click Insert Slicer.

Insert Slicer from PivotTable Analyze tab

  • In the Insert Slicers dialog box, select Product and States => click OK.

Insert Slicers dialog box

  • This will insert two slicers titled Product and States.

Slicers titled Product and States

  • Select any item in the Product Slicer, and you will see that the States slicer automatically shows the state where the product is available. The Pivot Table will show the price of that product.

Choose options from Product slicer to filter data


How to Reapply Filter After Editing Data in Excel

  • Filter the department column by “IT” as we have done previously.

Filter button in Department column

  • Change a filtered cell from “IT” to “Sales”.

Edit filtered data

  • You will see the Filter is not updating the list.

Change IT to Sales

  • To update the list, go to the Data tab => Sort & Filter group => click Reapply.

Reapply filter to edit data

You will see the updated filtered data.

Updated filtered data


How to Clear Filter in Excel

  • Click on the Filter button to bring up the filter options.

Filter is active

  • Select Clear Filter from “Department” option.

Clear Filter from Department

  • It will make the Filter inactive and show all of the data again.

Filtered data are cleared


How to Remove Filter in Excel

  • Navigate to the Data tab => Sort & Filter group => click the Filter icon to deactivate it.

Turn Filter button off

With the deactivation, Excel will remove the Filter button from your data.

Remove filter in Excel

Note: The shortcut key for both inserting and removing the filter is CTRL+SHIFT+L.

How to Fix If Filter Is Not Working in Excel

Sometimes you may face some problems, like the Excel filter not working after a certain row or not filtering the entire column. This may occur for several reasons.

  • If your data range includes blank rows, then you may face a problem because the Excel filter stops at blank row. In this case, select your data range manually before applying Filter. You can also Sort your data in ascending order and then apply the Filter command.
  • When Excel doesn’t update after any change in filtered data, just use the Reapply command.
  • Merged cells can interfere with the functioning of filters. If merging is necessary, then learn to filter in Excel with merged cells.
  • If there are variations in cell formats (such as text mixed with numbers), Excel might have difficulty applying filters. Ensure that all data in the filtered range is formatted consistently.

What Is the Difference Between Sort and Filter in Excel

  • Select a cell in the column you want to sort => Data tab => click Sort A to Z.

Apply Sort feature

It will expand the selection and sort your data in alphabetically ascending order.

Data sorted in ascending order

You can also access the Sort feature from the Filter drop-down options.

Sort options from Filter dropdown


Download Practice Workbook


Filter in Excel: Knowledge Hub


<< Go Back to Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Rafiul Hasan
Rafiul Hasan

Rafiul Hasan, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering & Technology, contributes significantly to the ExcelDemy project with almost 1.6 years of dedicated work. Currently an Excel and VBA Content Developer, he has a passion for problem-solving. Authoring over 100 articles for ExcelDemy showcases expertise in Microsoft Office Suites and Data Analysis. In addition to content development, Rafiul actively engages with the ExcelDemy forum, offering valuable solutions to user queries and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo