How to Sort Excel Data When a Header Is on Multiple Rows

Use sorting to rearrange your Excel data.
... BananaStock/BananaStock/Getty Images

Sorting in Excel is often tricky when you have more than one header row above your data. In most cases, especially when you're working with numerical data, Excel automatically detects the correct header row -- but you may run into problems when you sort data that includes text. If you just plan to sort your data one time, the simplest solution is to manually select your sort range; but if you need to sort the spreadsheet on a regular basis, use the filter feature to permanently define the sorting range.

1 Manual Selection

2 Highlight the entire range

Highlight the entire range of cells you want to sort, including the last header row. Leave out the extra rows at the top.

3 Click Sort Filter

Click "Sort & Filter" on the Home tab, and then select "Custom Sort."

4 Check the box

Check the box next to "My Data Had Headers," select the column or columns by which you want to sort, and then click "OK."

5 Use Filter to Define Sort Area

6 Highlight the bottom header row

Highlight the bottom header row. You can select just the cells in the row, or select the entire row.

7 Click Sort Filter on the Home tab

Click "Sort & Filter" on the Home tab, then select "Filter." Excel adds filter arrows to all the column names.

8 Click an arrow

Click an arrow and select a sorting option to sort the entire table by that column.

9 Click Sort Filter-2

Click "Sort & Filter" and select "Filter" again if you want to get rid of the arrows, but keep the sorting area defined by the filter. After the arrows are gone, you can sort normally; Excel ignores the extra header rows.

  • Information in this article applies to Microsoft Excel 2013. It may vary slightly or significantly with other versions or products.

Alan Sembera began writing for local newspapers in Texas and Louisiana. His professional career includes stints as a computer tech, information editor and income tax preparer. Sembera now writes full time about business and technology. He holds a Bachelor of Arts in journalism from Texas A&M University.