Sub topic 8
Filtering what the pivot table includes
This chapter assumes you can already build a pivot table with fields in Rows, Columns and Values. It also assumes you know what Summarize by does. The examples use a Sales sheet with these columns: A Date, B Region, C Status, D Product, E Revenue.
What a pivot filter does
A pivot filter removes source rows before the pivot table summarizes anything. This has three consequences:
- Hidden items do not count toward row totals, column totals or the grand total. The table stays internally consistent.
- You can filter on a field that is not used in Rows, Columns or Values. For example, you can exclude
Status = Returnedwithout showingStatusanywhere. - A filter acts on individual source values. It cannot act on aggregated results. You cannot say "show only regions whose total exceeds 10,000" with a pivot filter. Section "What filters cannot do" covers alternatives.
Adding a filter
- Click any cell inside the pivot table to open the pivot table editor on the right.
- Next to Filters, click Add and pick a field, such as
Status. - Open the filter's dropdown. Its status line reads Showing all items until you change it.
- Choose either Filter by condition or Filter by values, then click OK.
After you narrow the filter, the status line changes to something like Showing 2 items. Check this line whenever a pivot table looks short, because it is the quickest way to see that a filter is active.
Filter by values
Filter by values shows a list of every distinct value in the field, each with a checkbox.
- Select all ticks every item. Clear unticks every item.
- The search box narrows the visible list. It does not change which items are ticked until you use Select all or Clear on the result.
- Blank cells appear as (Blank). Untick it to drop records with no value in that field.
This mode suits fields with a small set of categories, such as region or status. For a field with hundreds of values, use a condition instead.
To keep only West and East, click Clear, then tick those two items. To exclude only Returned, leave everything ticked and untick Returned.
The two approaches behave differently when the data grows. A filter built by unticking one item says "everything except this". A filter built by ticking a few items says "only these". Whether a brand-new value, such as a new region, appears depends on how the filter was built. Test it by adding a row with a new value and checking the table.
Filter by condition
Filter by condition applies a rule to each source value. The choices depend on the data type of the field.
| Condition group | Examples | Typical use |
|---|---|---|
| Emptiness | Is empty, Is not empty | Drop records missing a value |
| Text | Text contains, Text does not contain, Text starts with, Text ends with, Text is exactly | Match product codes or name patterns |
| Dates | Date is, Date is before, Date is after | Limit to a period |
| Numbers | Greater than, Less than, Is between, Is not between, Is equal to | Ignore small transactions |
| Custom | Custom formula is | Rules the other options cannot express |
Some examples:
- On
Product, use Text starts withSKU-Ato include one product family. - On
Revenue, use Greater than100to leave out small orders. This filters individual source rows, not totals. - On
Date, use Date is after with an exact date such as2026-01-01, or with a relative option such as today.
A condition filter recalculates against the current data. If a new row matches the rule, it is included. This makes conditions the better choice for tables that grow.
Custom formula filters
Custom formula is accepts a formula that Sheets evaluates for each source row. Because it is the least predictable option, build it in steps:
- Write and test the formula in a scratch cell against the source sheet.
- Paste it into the filter dialog.
- Check the Showing N items status line and compare a total with a formula such as
SUMIFS.
Several filters at once
Every filter you add is combined with AND. A row must pass all of them to be included. With Status filtered to Completed and Region filtered to West, only rows that are both completed and in the West remain.
You cannot express OR across two different fields with the filter list. If you need "West in January or East in February", use a custom formula on one field or build the summary with QUERY.
Within a single field, ticking several values in a values filter is an OR. Region ticked for West and East includes rows from either region.
Filtering and the Rows and Columns fields
Each field in Rows or Columns also has its own sort and Show totals options. These are not filters. Sorting reorders items and Show totals controls subtotals. Neither removes any data. If an item is missing from the table, look in the Filters section, not in the Rows settings.
A field can be in both Rows and Filters at the same time. This is common. For example, put Region in Rows to display regions, and also in Filters to hide one of them. The two settings do not conflict, and the filter decides which regions exist in the table.
Cross-checking a filtered pivot table
After filtering, confirm the number with a formula built from the same criteria. Suppose the pivot table filters Status to exclude Returned and shows West revenue.
=SUMIFS(Sales!E:E, Sales!B:B, "West", Sales!C:C, "<>Returned")The same result with QUERY, which also handles several regions at once:
=QUERY(Sales!A1:E, "select B, sum(E) where C <> 'Returned' group by B label sum(E) 'Total revenue'", 1)If the formula and the pivot table disagree, the usual causes are a filter you forgot about, a source range that stops short, or numbers stored as text. The troubleshooting chapter covers these in depth.
What filters cannot do
Pivot filters work on source rows. They do not offer "top 10 by total" or "only groups with a total over X". Your options are:
- Sort the pivot table by the value column, descending, and read the first rows. Sorting is covered in the previous chapter.
- Use
QUERYwith ahavingclause, for example... group by B having sum(E) > 10000, when you need a real threshold on the aggregate. - Use a slicer, covered later, when you want users to change a filter interactively.
Common mistakes
- Forgetting that a filter is on. The table looks complete, but one status or region is missing. Check each filter's status line.
- Filtering a text-formatted number with a numeric condition. Values that look like numbers but are stored as text do not match "Greater than". Fix the source formatting first.
- Expecting a filter to change the Summarize by function. Filters choose rows. They never alter how values are calculated.
- Using values filters on high-cardinality fields. A field with many distinct values makes the checkbox list unwieldy and the filter hard to maintain. Use a condition.
- Assuming new categories will show up. Verify with a test row, as described in "Filter by values".
Exercise
A pivot table summarizes Revenue by Region. You add a filter on Status that unticks "Returned". The West total drops from 52,000 to 48,500. A colleague adds the Status field to Columns and sees a Returned column nowhere in the table. Why? Which formula would you write to check the new West total?
Show answer
The filter removes rows with Status "Returned" before grouping, so no Returned column can exist, and the West total no longer includes those rows. The 3,500 difference is the revenue of West rows that were returned. To check: =SUMIFS(Sales!E:E, Sales!B:B, "West", Sales!C:C, "<>Returned") should return 48,500.
Exercise
You want a pivot table of revenue by product, but only for orders with Revenue above 100 placed after 2026-01-01. Which filters do you add, how are they combined, and what can you not do with these filters if you also want only products whose total exceeds 5,000?
Show answer
Add a Revenue filter by condition "Greater than" 100 and a Date filter by condition "Date is after" 2026-01-01. Both are combined with AND, so a row must satisfy both. A pivot filter cannot test the aggregated product total. For that threshold, sort by the value column or use QUERY with "group by D having sum(E) > 5000".