Fix Excel Subtotal Using the Wrong Header Row
Question details
The user needs Excel Subtotal to recognize the correct column header row.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user is adding subtotals to a range of data and needs the correct headings to appear in the Subtotal dialog.
- Observed behavior
- Excel may treat the second row as the header when the selected range excludes the actual headings. The Subtotal command is unavailable when the data is an Excel table.
Identify the row that contains your column headings and check that each heading is unique, nonblank, and unmerged. Determine which column you want to group by and which numeric column you want to subtotal.
Select the complete range before adding subtotals
Use this method when the data is a normal range and Excel is using the wrong row as the header.
In the worksheet, make sure the first row of the intended range contains the correct column headings, with no blank or merged heading cells.
Select the data including its headings, then use Data > Sort to sort by the column whose values should define each subtotal group.
Select the complete data range again, starting with the correct header row and including all rows and columns to be subtotaled.
Choose Data > Subtotal. Under At each change in, select the grouping column; choose a function and the column to subtotal, then click OK.

Use a Total Row or convert an Excel table to a range
Use this method if the data is an Excel table and the Subtotal command is unavailable.
Work with spreadsheet data in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files in WPS Spreadsheets to continue working with your data and move between office suites more easily.

Frequently Asked Questions
Why does Excel treat my second row as the header?
The selected range may start below the actual headings. Cancel the Subtotal dialog, select the range starting with the correct header row, and reopen Data > Subtotal.
Why is the Subtotal command unavailable for my table?
Excel's Data > Subtotal command does not work directly on Excel tables. Use Table Design > Total Row for a table summary, or choose Table Design > Convert to Range before adding grouped subtotals.
Do I need to sort my data before adding subtotals?
Yes. Use Data > Sort to sort by the column selected under At each change in. This puts matching values together so Excel can subtotal each group.
Can I change the cells included in a SUBTOTAL formula?
Yes. Select the cell containing the formula and edit its range reference in the formula bar. This is separate from correcting the header selection for the Data > Subtotal command.




