30 Advanced Excel Tips for 2026

Excel Champs / Excel Basics / How to Sort Horizontally in Excel
By Puneet Gogia (Microsoft MVP)

How to Sort Horizontally in Excel

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

Have you ever wondered how you can horizontally sort data in Excel? I mean, sorting columns the way you sort rows. Want to know the best part?

So today, in this post, I’d like to share with you simple steps to horizontally sort data. And apart from this, I’d also like to share a simple tweak that you can do to sort columns in the custom order.

Note: It’s one of those Excel Tips that can help to get better at Basic Excel Skills.

Steps to Sort Columns in Excel

  • First of all, select the data you want to sort. Leave out the column with the row labels, or it will be sorted along with the data.
data to use to sort horizontally in excel
  • Go to Data Tab → Sort & Filter → click the Sort button. Now, you will get a pop-up window.
open sorting options to sort horizontally
  • You can also press Alt → A → S → S (one key after another) to open the Sort window.
  • Click the Options button → select “Sort left to right” & click OK.
select sort left to right to sort horizontally in excel
  • Now, select the row on the basis of which you want to sort your data & click OK.
select row to sort horizontally in excel

Congratulations! You have horizontally sorted your data.

sort horizontally data with sort columns in excel technique

With Excel tables, you are not able to use this technique, as a table can only be sorted top to bottom. Convert the table to a range first (Table Design → Convert to Range).

[Custom Order] Horizontal Sorting

In real life, there is more need to sort your columns in a custom order rather than using an alphabetic order. Follow these simple steps.

  • Add a temporary heading row at the top of your data set & use numbers to create a custom order.
Steps To Custom Sort Columns In excel
  • Now, open your sorting window.
  • And, sort columns by using your temporary row as a base.
  • After that, just delete the temporary heading row.

If you sort by names like months or weekdays, you don’t need a helper row: in the Sort window, choose Order → Custom List and pick the list (or type your own order).

Sort Horizontally with a Formula

In Microsoft 365 and Excel 2021 or later, the SORT function can sort columns too. Set its last argument (by_col) to TRUE. The following formula sorts the data in B1:F2 left to right by the values in row 1 and spills the sorted result:

=SORT(B1:F2,1,1,TRUE)

Use -1 as the third argument to sort largest to smallest. With SORTBY, you can sort by any row of the data, like row 2:

=SORTBY(B1:F2,B2:F2,-1)

Unlike the Sort window, the formula keeps the original data as it is, and the result updates when the data changes.

Frequently Asked Questions

Why is the Sort left to right option greyed out?

You are sorting an Excel table. Tables only sort top to bottom, so convert it to a range or use the SORT formula.

Why did my row labels move when sorting left to right?

The label column was part of the selection. Select only the data columns before you open the Sort window.

Can I sort left to right by more than one row?

Yes. In the Sort window, click Add Level and pick a second row to sort by when the first row has the same values.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

12 thoughts on “How to Sort Horizontally in Excel”

  1. You seem to know a lot about excel. Can you help with this one? I rarely have a header row and want to simply select the range (usually 4-5 columns and anywhere from 5 to 30 rows) and use the a-z (or z-a) button to sort against the 1st column.

    Now for the problem – more than half of the time, excel assumes that the first row is a header row and will not sort it with the rest. I realize I can go to the sort dialog box and un-check the “my data has headers” option. BUT, is there any way to permanently disable the automatic header row option? For the few times I sort with headers, it would be much more convenient to turn on the header row than it is to turn it off dozens of times a day.

    Reply
  2. Hi Puneet,
    I have not used this technique before .
    I have always just moved columns one by way,
    Your technique will be far better

    Reply
  3. Thanks Puneet , I was unaware of these tips. I really like the Custom Sort concept

    Reply
  4. The key board shortcut to bring Sort dialog box can also be “ALT+D, S

    Reply

Leave a Comment