Sub topic 8
Filtering What the Pivot Table Includes
Assume you already know how to create a pivot table and that your source data has one record per row. This chapter uses a sales table with fields such as Date, Region, Product, Salesperson, and Revenue.
A pivot-table filter removes source records from the pivot calculation without deleting them from the source sheet. The pivot table then recalculates its rows, columns, values, and totals from the remaining records.
Add a filter
- Click any cell in the pivot table.
- In the Pivot table editor, find the Filters section.
- Select Add.
- Choose a field, such as Region.
- Select the values or condition to include.
- Review the updated pivot table.
For example, a pivot table might summarize revenue by Region and Product:
| Region | Laptop | Monitor | Grand total |
|---|---|---|---|
| East | 12000 | 8000 | 20000 |
| West | 15000 | 9000 | 24000 |
| Grand total | 27000 | 17000 | 44000 |
Adding a Region filter that keeps only West changes the visible result:
| Region | Laptop | Monitor | Grand total |
|---|---|---|---|
| West | 15000 | 9000 | 24000 |
| Grand total | 15000 | 9000 | 24000 |
The source rows for East still exist. They are simply excluded from this pivot calculation.
Filter by values or by condition
Google Sheets provides two useful filtering approaches.
Filter by values lets you select exact items. Use it when you want specific regions, products, or salespeople. For example, you can keep West and South while excluding every other region.
Filter by condition evaluates each record against a rule. Use it when the matching set can change or when selecting values individually would be inconvenient. Examples include:
- Date is after a chosen date.
- Revenue is greater than 1,000.
- Product text contains “Pro”.
- Region is not equal to East.
A value filter usually shows a checklist. A condition filter shows a comparison rule and a value. Choose the filter type based on whether you have a fixed list or a logical test.
Combine filters
You can add filters for multiple fields. For example:
- Region is West.
- Product is Monitor.
- Date is in the current quarter.
A record must satisfy all active filters to appear in the calculation. These filters work like an AND operation. If a single record fails one filter, it is excluded.
Filters on different fields can also change totals. A grand total after filtering is the total for the included records, not the total for the complete source table.
Check the filter scope
A filter can hide all records if its condition does not match the source values. Check for:
- Extra spaces, such as
Westinstead ofWest. - Different spelling or capitalization.
- Dates stored as text instead of dates.
- Numbers stored as text.
- A filter applied to the wrong field.
The filter list can also reveal unexpected blank items. Blank values usually mean that some source rows have an empty cell in that field.
Exercise
A pivot table shows revenue by region. You need to see only West and South, while keeping all source rows available for later analysis. Which filter should you add?
Show answer
Add a filter for the Region field and select West and South in the value list. Do not delete the other source rows.