By default, data is sorted by rows, but you can choose to sort columns instead. And with the following trick, you aren’t limited to sorting them alphabetically.
Sort Columns with the Sort Dialog Box
Hidden in the Sort dialog box is an option to sort your data left to right, instead of the default top to bottom.
Insert a new blank row above the headers by right-clicking the row 1 heading and then selecting Insert.
In the new row, type numbers corresponding to the new sequence of the columns, with 1 being the leftmost column, then 2, 3, and so on, until each column has a number denoting its new location.
- Select a cell in the dataset.
- Press Ctrl+A to select the current region, including the two header rows.
On the Data tab, select Sort.
- Click the Options button.
- Select the Sort Left to Right option.
- Click OK to return to the Sort dialog box.
- In the Sort By drop-down, select Row 1.
- In the Sort On drop-down, select Values.
- In the Order drop-down, select Smallest to Largest.
Excel will rearrange the columns.
- Delete the temporary row added in step 1.