Sort Data by Column Headers Instead of Rows in Excel

As seen, there are multiple options for sorting data in Excel. However, most of those options refer to sorting the rows, not the content in the columns.

In the example below, we will show how to sort the data by column headers, rather than rows.

Sort Data by Column Headers Instead of Rows

For the example, we will use the list of Marvel movies with their release year, revenue rating, name, U.S. release date, and box office gross revenue:

Graphical user interface, table

Description automatically generated

Usually, when you want to sort the data, you would change the order of the range by the rows. But, as said, now we want to change the ordering of the column header (in the picture below):

To do this, we will select our data (range A1:E24), and then go to the Data tab >> Sort & Filter >> Sort:

Graphical user interface, application, Word

Description automatically generated

When we click on it, a pop-up window will be opened for us:

Graphical user interface, text, application, email

Description automatically generated

On this window, we will deselect My data has headers, then go to Options, and on another pop-up window that appears we will select Sort left to right on Sort Options:

Graphical user interface, text, application

Description automatically generated

We need to deselect the headers part to observe our first row as the one that can be edited and changed. Sorting from left to right refers to our rows while sorting from top to bottom refers to our columns.

When we click OK, we will notice that our sorting options will now be Rows, not Columns. We will click on the Row1 for Sort by option, Cell Values for Sort On, and we will order these cells from Z to A:

Graphical user interface, text, application

Description automatically generated

When we click OK now, these will change be reflected on the whole table:

Graphical user interface, table

Description automatically generated

Keep in mind that the formatting of the columns will remain unchanged, and that is the reason why our table seems a little bit messy and unreadable. We need to do this ourselves.

Tomasz Decker is an Excel specialist, skilled in data analysis and financial modeling.