Function Problems

Fix Excel Subtotal Using the Wrong Header Row

Aamir Naveed AkramAamir Naveed Akram Nov 22, 2026 868 views

Question details

The user needs Excel Subtotal to recognize the correct column header row.

Fix Excel Subtotal Using the Wrong 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.
Before you start

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.

Solution 1Recommended

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.

1
Check the headings

In the worksheet, make sure the first row of the intended range contains the correct column headings, with no blank or merged heading cells.

2
Sort the group column

Select the data including its headings, then use Data > Sort to sort by the column whose values should define each subtotal group.

3
Select the full range

Select the complete data range again, starting with the correct header row and including all rows and columns to be subtotaled.

4
Add subtotals

Choose Data > Subtotal. Under At each change in, select the grouping column; choose a function and the column to subtotal, then click OK.

Select the complete range before adding subtotals
Check the dialog headings: If the column names in the Subtotal dialog are still wrong, cancel it and check that the selection begins with the intended header row.
Free Microsoft Office alternative

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.

Work with spreadsheet data and summary calculations in WPS SpreadsheetsOpen and edit compatible Microsoft Excel XLS and XLSX filesUse a familiar interface for an easier transition from Microsoft OfficeAccess a free, lightweight office suite
microsoft office alternative - wps office

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.