How to Automatically Calculate Totals at Page Breaks in Excel
Question details
The user wants to generate and print aggregate totals automatically at the end of each page or grouped data section.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Printing grouped worksheet data and needing accurate subtotals and totals displayed at page breaks.
- Observed behavior
- Looking for a way to automatically insert page breaks and calculate totals for each group instead of adding rows and functions manually.
Ensure your data is organized in a standard tabular format with clear column headers, and confirm there are no completely blank rows or columns within your dataset.
Use the Subtotal Feature to Add Totals and Page Breaks
Excel's built-in Subtotal tool can automatically calculate grouped data and seamlessly insert page breaks after each group for organized printing.
The Subtotal feature works best when your data is grouped by a specific category. Before applying subtotals, you must sort the column you wish to group by, otherwise Excel will create a new group every time the value changes.
Select any cell in the column you want to group your data by. Navigate to the Data tab on the ribbon and click Sort A to Z or Sort Z to A.
Go to the Data tab, look for the Outline group (or Data Tools), and click on Subtotal.
In the Subtotal dialog box, set 'At each change in' to your sorted grouping column. Choose the calculation you need (e.g., Sum) in the 'Use function' drop-down, and check the boxes for the columns you want to calculate.
Check the box labeled 'Page break between groups'. Click OK to apply the subtotals and page breaks to your worksheet.
Easily Calculate Totals at Page Breaks in WPS Spreadsheet
WPS Spreadsheet offers a highly intuitive Subtotal tool that makes it incredibly easy to summarize grouped data and automatically insert page breaks, saving you time on complex worksheet formatting.
- 1. Sort Your Data: Open your file in WPS Spreadsheet, select your grouping column, and apply an ascending or descending sort from the Data tab.
- 2. Access Subtotals: Navigate to the Data tab and click on the Subtotal icon to open the configuration window.
- 3. Apply Settings and Page Breaks: Choose your calculation function, select the columns to total, check 'Page break between groups', and click OK.

Frequently Asked Questions
How do I remove the subtotals and page breaks once added?
To remove them, select any cell within your subtotaled data, go back to Data > Subtotal, and click the 'Remove All' button located at the bottom left of the dialog box.
Why is the Subtotal button grayed out in Excel?
The Subtotal feature is not supported if your data is formatted as an official Excel Table. You must convert it to a standard range first. Right-click anywhere in the table, select Table, and click 'Convert to Range'.
Can I calculate both sums and averages at the page breaks?
Yes. You can layer subtotals by running the Subtotal tool a second time. Choose your second function (like Average), but ensure you uncheck the 'Replace current subtotals' box before clicking OK.




