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.
Highlight the entire range of cells you want to sort, including the last header row. Leave out the extra rows at the top.
Click "Sort & Filter" on the Home tab, and then select "Custom Sort."
Check the box next to "My Data Had Headers," select the column or columns by which you want to sort, and then click "OK."
Use Filter to Define Sort Area
Highlight the bottom header row. You can select just the cells in the row, or select the entire row.
Click "Sort & Filter" on the Home tab, then select "Filter." Excel adds filter arrows to all the column names.
Click an arrow and select a sorting option to sort the entire table by that column.
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.
- BananaStock/BananaStock/Getty Images