Formatting Issues

Keep Excel Table Headers Visible While Sorting Data

John WilsonJohn Wilson Nov 18, 2026 869 views

Question details

Keep a header row in place and add filter drop-downs that sort the data rows below it.

Keep Excel Table Headers Visible While Sorting Data
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.
Before you start

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.

Solution 1Recommended

Create an Excel table with header filter drop-downs

Use a table to keep headers separate from the data rows when sorting.

1
Select the data range

Select all the columns and rows you want to sort, including the column headers but excluding any separate title row.

2
Create the table

Choose Insert > Table. Check the selected range in the dialog, select My table has headers, and click OK.

3
Sort a column

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.

4
Keep headers visible while scrolling

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.

Create an Excel table with header filter drop-downs
Sorting and scrolling are separate: The table keeps headers out of the sorted data. Freeze Panes keeps them visible when you scroll, and also freezes any rows above them.
WPS Spreadsheet

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. 1. Open the spreadsheet: Open WPS Spreadsheet and use File > Open to select your Excel workbook.
  2. 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. 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. 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. 5. Save the workbook: Choose File > Save As and select an Excel format such as XLSX to save the updated workbook.
Sort and filter data from column header drop-downsKeep header rows visible with Freeze PanesOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface for free
microsoft office alternative - wps office

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.