Keep Excel Table Headers Visible While Sorting Data
Question details
Keep a header row in place and add filter drop-downs that sort the data rows below it.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to sort a data range without moving its column headers and keep the headers visible while scrolling.
- Observed behavior
- The desired result is a fixed header row with drop-downs for sorting and filtering the data beneath it.
Make sure the data range has one row of column headers and no completely blank rows or columns within it. Identify any separate title row so you can exclude it from the table.
Create an Excel table with header filter drop-downs
Use a table to keep headers separate from the data rows when sorting.
Select all the columns and rows you want to sort, including the column headers but excluding any separate title row.
Choose Insert > Table. Check the selected range in the dialog, select My table has headers, and click OK.
Click the filter arrow in a table header and choose a sort option, such as Sort A to Z or Sort Smallest to Largest. Excel sorts the table's data rows without moving the headers.
If the headers are in the first worksheet row, choose View > Freeze Panes > Freeze Top Row. If they are lower down, select the row immediately below the headers and choose View > Freeze Panes > Freeze Panes.

Sort Data Under Fixed Headers in WPS Spreadsheet
Use filter drop-downs in WPS Spreadsheet to sort data below its headers, then freeze the header row to keep it visible while scrolling.
- 1. Open the spreadsheet: Open WPS Spreadsheet and use File > Open to select your Excel workbook.
- 2. Select the range: Select the header row and all data rows and columns you want to sort. Leave any separate title row outside the selection.
- 3. Add filters and sort: Choose Data > Filter, then click a header's drop-down arrow and select a sort order. The data rows are sorted beneath the headers.
- 4. Freeze the headers: Select the row immediately below the headers, then choose View > Freeze Panes > Freeze Panes. To freeze headers in the first row only, choose Freeze Top Row instead.
- 5. Save the workbook: Choose File > Save As and select an Excel format such as XLSX to save the updated workbook.

Frequently Asked Questions
Why did my header row move when I sorted?
Excel may have treated the header as data. Select the full range, choose Insert > Table, and make sure My table has headers is selected before sorting with a header drop-down.
Should I include a title row when creating the table?
No. Select the column header row and the data beneath it, but leave a separate title row outside the range before choosing Insert > Table.
How do I keep headers visible if they are not in the first row?
Select the row immediately below the headers, then choose View > Freeze Panes > Freeze Panes. This also freezes any rows above the headers.
Does creating a table automatically freeze the header row?
No. A table separates headers from sorted data, but to keep the header row visible while scrolling, use View > Freeze Panes.




