How to Set a Filter in a Pivot Table
In this article
To set a filter in a pivot table, drag the field you want to filter into the Filters area (or use the filter drop-down on a row or column label), then choose the values or conditions you want to keep. In Excel, click the drop-down arrow next to the field name and pick your criteria; in Google Sheets, use the filter icon in the pivot table editor. The exact clicks differ slightly between Excel for Windows, Excel for Mac, and Google Sheets, but the concept is the same: you are limiting which source rows contribute to the summary.
What You'll Need
- A spreadsheet application with pivot table support (Microsoft Excel, Google Sheets, or LibreOffice Calc).
- A source data range with a header row and no completely blank rows or columns inside the range.
- An existing pivot table, or the steps to create one (Insert > PivotTable in Excel; Insert > Pivot table in Google Sheets).
Step-by-Step
- Select any cell inside your pivot table. This activates the PivotTable Analyze and Design tabs in Excel, or opens the pivot table editor sidebar in Google Sheets. If you have not built the pivot table yet, create one first from your data range.
- Decide where the filter belongs. A filter on a field in the Filters area (called a report filter or page filter) limits the entire pivot table to one or more items. A filter on a row or column label hides individual items but keeps the rest of the layout. Use the Filters area when you want a single control at the top; use the label drop-down when you want to hide a few specific rows.
- Add the field to the Filters area. In Excel, drag the field name from the PivotTable Fields pane into the Filters box. In Google Sheets, click Add next to Filters in the pivot table editor and choose the field. The field appears as a drop-down above the pivot table.
- Open the filter drop-down. Click the arrow next to the field name above the pivot table (Excel) or the filter control in the editor (Google Sheets). A list of all unique values in that field appears, each with a checkbox.
- Choose your values. Tick the items you want to include. To keep only a few, first untick Select All (Excel) or clear the list, then tick the ones you need. In Google Sheets, use the Filter by values section and tick the boxes.
- Apply the filter. Click OK in Excel or click outside the drop-down in Google Sheets. The pivot table recalculates and shows only the rows that match your selection.
- Add a condition-based filter if needed. In Excel, open the drop-down and choose Label Filters or Value Filters for text, date, or number conditions (for example, Greater Than 1000 or Begins With "North"). In Google Sheets, use Filter by condition in the editor and pick a condition from the list. These are more flexible than ticking individual items.
- Clear or change the filter later. Reopen the drop-down and either tick Select All (Excel) or choose Clear filter (Google Sheets) to remove it. To remove the field from the Filters area entirely, drag it out of the box in Excel or click the X next to it in the Google Sheets editor.
Menu labels can differ slightly by version, device, and region. The steps above describe Excel for Windows and Google Sheets in a desktop browser; Excel for Mac uses the same PivotTable Fields pane but the ribbon tab names may vary, and the Google Sheets mobile app has limited pivot table editing compared with the desktop browser version.
Common Mistakes
- Filtering the source data instead of the pivot table. A filter applied to the raw data range does not automatically update a pivot table that was built before the filter. Refresh the pivot table after filtering the source, or apply the filter inside the pivot table itself.
- Putting the field in the wrong area. Dropping a field into Rows when you meant Filters changes the layout instead of limiting the whole table. Check which box the field landed in.
- Forgetting to refresh. If source data changes, the pivot table keeps the old values until you refresh (right-click > Refresh in Excel; the refresh icon in Google Sheets). A filter may appear not to work because the cached data is stale.
- Filtering on a field that is not in the pivot table. In Excel you can only filter on fields that are already placed in the pivot table. Add the field to the Filters area first.
- Assuming hidden rows are deleted. Filtering only hides data from the summary; the underlying source rows are untouched.
Tips
- Use a slicer for a more visual filter control. In Excel, select the pivot table and choose Insert > Slicer, then pick the field. Slicers are clickable buttons that make it obvious which filter is active.
- Name your pivot table (PivotTable Analyze > PivotTable Name) so formulas and references are easier to manage when you add filters.
- If you filter by date, group the date field first (right-click a date > Group) so you can filter by month, quarter, or year instead of individual days.
- Keep a copy of the unfiltered pivot table on another sheet if you need to compare filtered and total results.
Troubleshooting
- The filter drop-down is greyed out or missing. Make sure you have selected a cell inside the pivot table, not outside it. In Excel, the field must be in the pivot table before it can be filtered.
- The pivot table shows no data after filtering. Your selected values may not match any rows, or the field may contain blanks. Clear the filter and check the source data for typos or extra spaces.
- New source rows do not appear in the filter list. Refresh the pivot table. If the source range was extended, you may need to change the data source (PivotTable Analyze > Change Data Source).
- The filter resets when you reopen the file. This can happen if the pivot table was built from an external connection that refreshes on open. Check the connection properties and turn off Refresh data when opening the file if you want to keep the last filter state.
- Google Sheets filter does not apply. Confirm you clicked outside the filter box to commit the change, and that the pivot table editor is still open. Reload the page if the editor stops responding.
Frequently Asked Questions
Can I filter a pivot table by multiple fields at once?
Yes. Add more than one field to the Filters area and set each drop-down independently. The pivot table shows only rows that meet all active filters.
What is the difference between a filter and a slicer?
A filter is a drop-down menu; a slicer is a set of on-screen buttons that controls the same filter. Slicers are available in Excel and are easier to use on touch screens or shared dashboards.
Does filtering a pivot table change the original data?
No. Filters only affect what the pivot table displays. The source cells remain unchanged.
Can I save a pivot table with a filter applied?
Yes. In Excel and Google Sheets, the filter state is saved with the file. When you reopen it, the same filter is still active unless the data source refreshes and changes the available values.
Why does my filter show values that are not in the data?
The pivot table may be using cached data from an earlier refresh. Refresh the pivot table, or check that the source range does not include extra rows with stray text or spaces.
Can I filter by a value that is not shown in the pivot table?
In Excel, filters are limited to fields already placed in the pivot table. Add the field to the Filters area first, then choose the value. In Google Sheets, the editor lists fields from the source range, so you can add a filter field directly.