Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS

Excel Tutorial

Excel HOME Excel Introduction Excel Get Started Excel Overview Excel Syntax Excel Ranges Excel Fill Excel Move Cells Excel Add Cells Excel Delete Cells Excel Undo Redo Excel Formulas Excel Relative Reference Excel Absolute Reference Excel Arithmetic Operators Excel Parentheses Excel Functions

Excel Formatting

Excel Formatting Excel Format Painter Excel Format Colors Excel Format Fonts Excel Format Borders Excel Format Numbers Excel Format Grids Excel Format Settings

Excel Data Analysis

Excel Sort Excel Filter Excel Tables Excel Conditional Format Excel Highlight Cell Rules Excel Top Bottom Rules Excel Data Bars Excel Color Scales Excel Icon Sets Excel Manage Rules (CF) Excel Charts

Excel PivotTables

Excel PivotTable Intro Excel Create PivotTable Excel PivotTable Values Excel PivotTable Filter Excel PivotTable Group Excel Calculated Field Excel PivotChart

Excel Case

Case: Poke Mart Case: Poke Mart, Styling

Excel Functions

AND AVERAGE AVERAGEIF AVERAGEIFS CONCAT COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS DATEDIF FILTER HLOOKUP IF IFERROR IFS INDEX INDEX MATCH LEFT LEN LOWER MATCH MAX MEDIAN MID MIN MODE NETWORKDAYS NPV OR PROPER RAND RIGHT ROUND SORT STDEV.P STDEV.S SUBSTITUTE SUM SUMIF SUMIFS SUMPRODUCT TEXTJOIN TODAY TRIM UNIQUE UPPER VLOOKUP XLOOKUP XOR

Excel How To

Convert Time to Seconds Difference Between Times NPV (Net Present Value) Remove Duplicates

Excel Cert

Excel Certificate

Excel Examples

Excel Exercises Excel Syllabus Excel Study Plan Excel Training

Excel References

Excel Keyboard Shortcuts


Excel PivotTable Filter and Slicers


Share

Filter a PivotTable

Filters let you focus on part of the data, for example one region or the best-selling products.

The source data does not change. Only the PivotTable shows less.

This chapter uses Poke Mart sales data. Download it to follow along: poke_mart_sales.xlsx

Start with a PivotTable that has Category in Rows and Sum of Sales in Values, formatted with a thousands separator. See Create a PivotTable and PivotTable Values.

The Filters Area

A field in the Filters area filters the whole PivotTable.

Let's show the sales of the Johto region only:

  1. Drag Region to the Filters area
  2. Excel adds a filter above the PivotTable, in A1:B1. It shows (All)
  3. Click the arrow in B1
  4. Choose Johto
  5. Click OK
AB
1RegionJohto
2
3Row LabelsSum of Sales
4Balls1,647,600
5Medicine1,516,300
6Status Healers199,750
7Grand Total3,363,650

Only the Johto orders are counted now. Johto sold 3,363,650 of the 9,416,800 total.

To pick more than one region, check Select Multiple Items at the bottom of the list. The filter cell then shows (Multiple Items).

To remove the filter, choose (All) again.



Sort a PivotTable

Set the Region filter back to (All). Then uncheck Category and drag Product to the Rows area.

Excel lists the products from A to Z. To put the best sellers on top:

  1. Right-click any number in the Sum of Sales column
  2. Choose Sort > Sort Largest to Smallest
AB
1Region(All)
2
3Row LabelsSum of Sales
4Poke Ball1,821,600
5Great Ball1,677,600
6Super Potion1,545,600
7Potion1,527,000
8Ultra Ball948,000
9Revive723,000
10Hyper Potion618,000
11Paralyze Heal195,600
12Awakening180,500
13Antidote179,900
14Grand Total9,416,800

The Poke Ball is the best seller. The Antidote sells the least.

To sort by name again, click the arrow in A3 (Row Labels) and choose Sort A to Z.

Read more about sorting in Excel Sort.


Label Filters and Value Filters

Click the arrow in A3 (Row Labels). The menu has two kinds of filters:

  • Label Filters filter by the names of the items, for example products that contain a word
  • Value Filters filter by the numbers, for example the top 3 products by sales

Label Filter

Show only the products with "Potion" in the name:

  1. Click the arrow in A3
  2. Choose Label Filters > Contains
  3. Type Potion
  4. Click OK
AB
3Row LabelsSum of Sales
4Super Potion1,545,600
5Potion1,527,000
6Hyper Potion618,000
7Grand Total3,690,600

The sort from before still applies.

To remove the filter, click the arrow in A3 and choose Clear Filter From "Product".

Value Filter: Top 3

Clear the label filter first. Then show the three best-selling products:

  1. Click the arrow in A3
  2. Choose Value Filters > Top 10
  3. The dialog says Top 10 Items by Sum of Sales. Change 10 to 3
  4. Click OK
AB
3Row LabelsSum of Sales
4Poke Ball1,821,600
5Great Ball1,677,600
6Super Potion1,545,600
7Grand Total5,044,800

The Grand Total only adds up the items you can see: 5,044,800, not 9,416,800.

The same dialog can show the Bottom items instead, or a percent or sum of the total instead of a number of items.

Clear the filter before you go on.


Slicers

A slicer is a box of buttons that filters the PivotTable.

It is easier to use than the filter arrows, and it shows which filter is on at a glance.

Remove Region from the Filters area first. Then add a slicer for Region:

  1. Click any cell in the PivotTable
  2. Click PivotTable Analyze > Insert Slicer
  3. Check Region
  4. Click OK
  5. Click Johto in the slicer

To select more than one item, hold down Ctrl while you click, or turn on the Multi-Select button at the top of the slicer.

To show everything again, click the Clear Filter button in the top right corner of the slicer.

Timeline

A timeline is a slicer for dates. It needs a column with real Excel dates, like the Date column.

  1. Click any cell in the PivotTable
  2. Click PivotTable Analyze > Insert Timeline
  3. Check Date
  4. Click OK
  5. The timeline shows months. Click MONTHS in its top right corner and choose YEARS
  6. Click 2025

A PivotTable with a Region slicer set to Johto and a Date timeline set to 2025

With Johto in the slicer and 2025 in the timeline, the PivotTable shows the Johto sales for 2025:

AB
3Row LabelsSum of Sales
4Poke Ball401,000
5Potion321,600
6Great Ball291,600
7Super Potion217,700
8Ultra Ball184,800
9Revive123,000
10Hyper Potion122,400
11Awakening39,500
12Paralyze Heal27,000
13Antidote22,600
14Grand Total1,751,200

The Date field is not in the PivotTable at all, but the timeline can still filter by it.

One slicer can also control several PivotTables that use the same data: right-click the slicer, choose Report Connections, and check the PivotTables it should filter.


Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.