How to Filter Excel Pivot Table (8 Effective Ways)

This is our dataset where the Product Category is given with an Order Date, Quantity, and Sales based on the States of the U.S.

Dataset

We created a Pivot Table which is as follows. Let’s dive into the methods of filtering it.

Created Pivot Table


Method 1 – Using Report Filter to Filter an Excel Pivot Table

  • To turn on Report Filter, select the States field and drag down the field into the Filters areas.

Using Report Filter to Filter Excel Pivot Table

  • You’ll see a drop-down arrow with the field States.

Using Report Filter to Filter Excel Pivot Table

  • Click on the drop-down arrow and you’ll get all states in the filtering option.
  • Select Arizona and press OK.

Using Report Filter to Filter Excel Pivot Table

  • The table has been filtered to use information related to Arizona only.

Using Report Filter to Filter Excel Pivot Table


Method 2 – Utilizing Value Filters

Case 2.1 – Value Filters to Get Top Items

Let’s filter the top 5 items based on total sales.

  • Click on the drop-down arrow of Row Labels.
  • Go to Value Filters and choose Top 10.

Utilizing Value Filters to Filter Excel Pivot Table

  • Input 5 instead of 10 and press OK.

Utilizing Value Filters

  • This is the expected output.

Utilizing Value Filters


Case 2.2 – Value Filters to Return 

Let’s filter the top 50% sum of sales from the total sum of sales.

  • Go to the Top 10 filter (see the previous case).
  • And input 50 instead of 10, choose Percent in the box next to it, and press OK.

Utilizing Value Filters

  • The following products are in the top 50% sales of total sales.

Utilizing Value Filters to Filter Excel Pivot Table


Case 2.3 – Value Filters for a Specific Value

Suppose you want to get the sum of sales that is greater than 2,500.

  • Click on the drop-down arrow of Row Labels.
  • Go to Value Filters and choose Greater Than.

Utilizing Value Filters

  • Put the specified value in the box (2500) and press OK.

Utilizing Value Filters

  • You’ll get the following output where all the sum of sales is greater than 2,500.

Utilizing Value Filters


Method 3 – Applying Label Filters to Filter an Excel Pivot Table

Let’s filter the product category that contains Books only and find the sum of sales for Books.

  • Click on the drop-down arrow for Row Labels.
  • Go to Label Filters and pick Contains.

Applying Label Filters to Filter Excel Pivot Table

  • Type the word Books in the textbox of the Label Filter dialog box.

Applying Label Filters to Filter Excel Pivot Table

  • Press OK, and you’ll get the filtered Pivot Table on the basis of Books.

Applying Label Filters to Filter Excel Pivot Table


Method 4 – Creating Date Filters

Let’s filter the Pivot Table for a specific date range e.g. 02-15-22 to 5-10-22.

  • Drag the Order Date field inside the Rows areas when creating the pivot table.

Creating Date Filters

  • Go to Label Filters and select Between.

Creating Date Filters

  • Input the desired dates in the Label Filter dialog box.

Creating Date Filters

  • Press OK, and you’ll get the following output.

Creating Date Filters


Method 5. Using the Search Box to Filter an Excel Pivot Table

You can type the word (e.g. Ohio as shown in the following figure) that you want to use to filter the Pivot Table.

Using Search Box to Filter Excel Pivot Table

Here’s the filtered Pivot Table for Ohio.

Using Search Box to Filter Excel Pivot Table


Method 6 – Using AutoFilter to Screen a Pivot Table

Here’s a conundrum. The Filter option is not working for the Pivot Table as shown in the following figure.

Using AutoFilter

But when we keep the cursor over a cell adjacent to the Pivot Table, the Filter option is working. We can pick it from there.

Using AutoFilter

After clicking on the Filter option, you’ll see surprising drop-down arrows for all columns. You can filter any column without following other methods.

Using AutoFilter


Method 7 – Filter Multiple Items in an Excel Pivot Table

Case 7.1 – Filter Multiple Items Using a Slicer

  • Select a cell within the Pivot Table.
  • Go to Insert tab and choose Slicer from the Filters ribbon.
  • Choose States in the Insert Slicer dialog box.

Filter Multiple Items Using Slicer

  • You will see a moveable filtering option of States (the right side of the following picture).

Filter Multiple Items Using Slicer

  • Select a state (e.g. Arizona) from the options.
  • You’ll get the filtered table based on the state you chose.

Filter Multiple Items Using Slicer


Case 7.2 – Filter Multiple Items Using Commas

  • Input the following formula in the G4 cell.
=TEXTJOIN(",",TRUE,B6:B15)

Here, “,” is the delimiter, TRUE for ignoring empty cells, B6:B15 is the cell range for the Product Category of the dataset.

Filter Multiple Items Using Comma

  • After entering the formula, we’ll get the filtering criteria in a single cell, and can use it in the Slicer.

Filter Multiple Items Using Comma

Here, the filtering criteria i.e. Books, Sports are seen in the G4 cell.


Case 7.3 – Filter Multiple Items Using Filter Criteria

  • Copy the Pivot Table by pressing Ctrl + C.
  • Paste the table close to the existing table by pressing Ctrl + V.
  • Here’s how you can create the setup.

Filter Multiple Items Using Filter Criteria

  • Keep the Row Labels only in the second Pivot Table.
  • If you choose any state (e.g. Florida) from the Slicer, the filtering method will work for both Pivot Tables simultaneously.
  • The first Pivot Table filters product categories while the second table filters based on States.

Filter Multiple Items Using Filter Criteria

  • Right-click on the Slicer and select the Report Connections option.

Filter Multiple Items Using Filter Criteria

  • You’ll get the following figure. The figure demonstrates that PivotTable19 (the first table) & PivotTable21 (the second table) are joined.

Filter Multiple Items Using Filter Criteria


Method 8 – Excel Pivot Table Filtering Based on a Cell Value Using VBA 

Let’s filter the whole Pivot Table to display results for Florida (located at the E7 cell).

Excel Pivot Table Filter Based on a Cell Value Using VBA

Steps:

  • Open a module by clicking Developer and selecting Visual Basic.

How to Insert VBA Code

  • Go to Insert and pick Module.

How to Insert VBA Code

  • Copy the following code into your module:
Sub Filter_UsingVBA()
   Dim pvFld As PivotField
   Dim strFilter As String
   Set pvFld = ActiveSheet.PivotTables("PivotTable23").PivotFields("States")
   strFilter = ActiveWorkbook.Sheets("Sheet14").Range("E7").Value
   pvFld.CurrentPage = strFilter
End Sub

Excel Pivot Table Filter Based on a Cell Value Using VBA

In the above code, we declared pvFld as PivotField and strFilter as String type. Then the required sources for pvFld and strFilter are fixed.

Three basic things in the code are-

  • Pivot Table Name: PivotTable23
  • Field Name of the Table: States
  • Active Sheet Name: Sheet14
  • Location of Filter Value: E7 cell.
  • Run the code (the keyboard shortcut is F5 or Fn + F5). You’ll get the filtered output.

Excel Pivot Table Filter Based on a Cell Value Using VBA


Download Practice Workbook


How to Filter Excel Pivot Table: Knowledge Hub


<< Go Back to Pivot Table in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdul Kader
Md. Abdul Kader

MD. ABDUL KADER is an engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SWM, GIS, RS, and SPSS. He holds a B.Sc in Urban & Regional Planning from Chittagong University of Engineering and Technology and has shifted to become a content developer. In this role, he crafts technical content centred around... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo