Filter Excel Data and Add Category Subtotals with a PivotTable
Question details
Create a filtered report that calculates subtotals for each category.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to group records by category, filter the report, and total numeric fields for each group.
- Observed behavior
- The desired report shows category totals that can be updated as the source data changes.
Make sure the source data has a header row, a Category column, and numeric columns to total. Remove blank header cells and check that values to be summed are stored as numbers.
Create a PivotTable with category subtotals and filters
Use a PivotTable for a maintainable report that groups and filters data by category.
Select a cell in the source range, choose Insert > Table, confirm the range and headers, and select OK.
Select a cell in the table, choose Insert > PivotTable, select where to place the report, and click OK.
In the PivotTable Fields pane, drag Category to Rows and each numeric field, such as Quantity or Boxes, to Values. To show detail groups beneath each category, drag an additional detail field below Category in Rows.
For each numeric Values field, open Value Field Settings and select Sum. Drag a field to Filters or use a Row Labels dropdown to filter the report. If you added a detail row field, select the PivotTable and choose Design > Subtotals > Show all Subtotals at Bottom of Group.
After adding or changing source data, right-click the PivotTable and select Refresh to update the report.
Build category subtotals in WPS Spreadsheets
Use a PivotTable in WPS Spreadsheets to group numeric data by category, filter the report, and refresh its totals when the source data changes.
- 1. Open your spreadsheet: Open WPS Spreadsheets and use File > Open to select the workbook containing your source data.
- 2. Insert a PivotTable: Select the source range, then choose Insert > PivotTable and confirm the range and report location.
- 3. Group and total the data: In the PivotTable field list, drag Category to Rows and numeric fields to Values. Set the value calculation to Sum if needed.
- 4. Filter and refresh: Drag a field to Filters or use a row filter dropdown. After changing the source data, right-click the PivotTable and select Refresh.

Frequently Asked Questions
How do I filter the PivotTable by category?
Open the Row Labels dropdown and select the categories to display. You can also drag Category to the Filters area if you prefer a report-level filter.
Why does my PivotTable count values instead of summing them?
The source column may contain text or nonnumeric values. Correct the source data, refresh the PivotTable, and use Value Field Settings to select Sum.
Will new source rows appear in the report automatically?
An Excel Table can expand to include new rows, but the PivotTable generally needs a refresh. Right-click it and select Refresh after adding data.
How can I show a separate subtotal below each category?
Add a detail field below Category in the Rows area, then select the PivotTable and choose Design > Subtotals > Show all Subtotals at Bottom of Group.




