Calculation Issues

How to Automatically Calculate Totals at Page Breaks in Excel

Steven ParkerSteven Parker Oct 14, 2026 871 views

Question details

The user wants to generate and print aggregate totals automatically at the end of each page or grouped data section.

How to Automatically Calculate Totals at Page Breaks in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Sort the Grouping Column

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.

2
Open the Subtotal Dialog

Go to the Data tab, look for the Outline group (or Data Tools), and click on Subtotal.

3
Configure the Calculation

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.

4
Enable Page Breaks

Check the box labeled 'Page break between groups'. Click OK to apply the subtotals and page breaks to your worksheet.

Verify Before Printing: Press Ctrl + P to open the Print Preview. You can now verify that each group prints on a separate page with its corresponding subtotal.
Simplify Data Management

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. 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. 2. Access Subtotals: Navigate to the Data tab and click on the Subtotal icon to open the configuration window.
  3. 3. Apply Settings and Page Breaks: Choose your calculation function, select the columns to total, check 'Page break between groups', and click OK.
Fully compatible with Microsoft Excel (.xlsx and .xls) file formats.Intuitive Subtotal tool for effortless data grouping and calculation.Free, lightweight, and fast alternative for daily spreadsheet tasks.
microsoft office alternative - wps office

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.