How to Format Subtotals and Sort Data in Pivot Tables
Question details
The user wants to apply distinct subtotal formatting across multiple hierarchy levels, control selective subtotal visibility, sort items by specific values like market value, and modify layout lines beneath grouped data.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Customizing a complex Pivot Table report to meet specific visual and sorting requirements for different data hierarchy levels.
- Observed behavior
- Standard Pivot Table options apply uniform formatting to subtotals and have limitations on selective visibility per hierarchy level directly from the default style menus.
Before applying advanced formatting, ensure your source data is clean, formatted as a standard Table, and backed up in a sample workbook with non-sensitive data for testing custom layouts.
Customize Pivot Table Subtotal Visibility and Layout
Change how and where subtotals appear, or remove them for specific fields to declutter your report.
Standard PivotTable styles allow you to globally show or hide subtotals. However, you can also toggle them for individual fields to achieve selective visibility.
Select any cell inside your Pivot Table to reveal the PivotTable Tools on the top ribbon.
Go to the 'Design' tab, click on 'Subtotals', and choose 'Do Not Show Subtotals', 'Show all Subtotals at Bottom of Group', or 'Show all Subtotals at Top of Group'.
To hide subtotals for a specific field only, right-click the field header within the Pivot Table and uncheck 'Subtotal [Field Name]' from the context menu.
To add a separating line beneath each fund or group, stay on the 'Design' tab, click 'Blank Rows', and select 'Insert Blank Line after Each Item'.

Sort Pivot Table Items by Specific Values
Sort your hierarchy levels (e.g., security level) based on aggregated data like market value rather than alphabetical order.
Format Subtotals Using Conditional Formatting
Overcome standard formatting limitations by using conditional formatting rules to target specific subtotal rows.
Create and Format Pivot Tables with WPS Spreadsheet
WPS Spreadsheet provides robust Pivot Table features, allowing you to easily summarize, sort, and format large datasets. It is fully compatible with Microsoft Excel file formats, ensuring your complex reports render perfectly.
- 1. Open Your Data: Launch WPS Spreadsheet and open your dataset.
- 2. Insert a Pivot Table: Go to the 'Insert' tab and click 'PivotTable'.
- 3. Build Your Report: Select your data range, choose a destination, and drag fields into the Rows, Columns, and Values areas.
- 4. Customize Layout: Use the 'Design' tab to adjust subtotal visibility, insert blank rows, and apply custom sorting to your hierarchy levels.

Frequently Asked Questions
Can I format subtotals for different hierarchy levels differently?
By default, Pivot Table styles apply uniform formatting to all subtotal levels. To achieve distinct formatting per level, you must manually apply styles or use custom Conditional Formatting rules based on the row text.
How do I hide the subtotal for just one specific column?
Right-click the header of the specific field in your Pivot Table and click on 'Subtotal [Field Name]' to toggle its visibility off without affecting the subtotals of other fields.
Why won't my Pivot Table sort by market value?
Ensure you are applying the sort to the correct row label. Click the filter arrow on the row field you want to sort, choose 'More Sort Options', and explicitly select the 'Sum of Market Value' field as the sorting criteria.
How can I add a blank line below each group in a Pivot Table?
Under the PivotTable Tools 'Design' tab, click on 'Blank Rows' and select 'Insert Blank Line after Each Item' to create visual separation between your fund or security groups.




