In Excel, to sort columns of the table, I will number the columns and use the Sort feature.
The following dataset contains some information about ice-creams.
Now I want to sort the columns on my own. To accomplish the task, I perform the following steps:
I insert a new row above the data, by right-clicking on the first row and selecting Insert.
I enter a number in each column in the new row for sorting the columns. For example, I want the CID column to be the first column. So, I enter 1 in E1. Similarly, I do the same for rest of the columns. The final numbering goes as follows:
Select the entire source data range including the numbers in the new row. Go to the Data tab and select Sort. The Sort dialog box will open. Click on the Options button. Select the Sort left to right option and click OK, like shown below:
From the Sort by menu, I select Row 1 as the numbers entered are on the first row:
Click OK and the columns will be sorted, like shown below:
You can now delete the row which we created for sorting the columns.
I hope this post helped you.