How to Sort and Arrange Data in Excel (Step by Step)
Sorting puts your rows in a useful order, such as customers from A to Z or sales from biggest to smallest. It changes the order of the rows, not the data inside them.
Sort one column in seconds
- Click any cell in the column you want to sort.
- Go to the Data tab.
- Click A to Z or Z to A. For numbers, the buttons read Smallest to Largest and Largest to Smallest.
Sort by more than one column
- Click a cell in your table and choose Data → Sort.
- Pick the first column, for example Region, and an order.
- Click Add Level and pick the second column, for example Revenue, from Largest to Smallest.
- Tick My data has headers and click OK.
Use a custom order
Months and sizes sort in the wrong order if you sort them A to Z. In the Sort box, open the Order list, choose Custom List and pick January, February and so on, or Small, Medium, Large.
Sort by cell color
In the Sort box, change Sort On to Cell Color and choose which color goes first.
The SORT function
In Excel 365 and Excel 2021 you can sort with a formula that leaves your original table alone:
=SORT(A2:D100, 3, -1)
This sorts by the third column, biggest first.
Common problems
- Only one column moved. You selected a single column. Click one cell inside the table, or select every column, before you sort.
- Numbers sort as 1, 10, 2. They are stored as text. Convert them to real numbers.
- The header row got sorted. Tick My data has headers.
- You want the old order back. Before sorting, add a column numbered 1, 2, 3 and so on. Sort by it later to return to the original order.
Sort in your browser
Upload your file to DataGenius BI and click any column heading in the data table to sort it. Click again to reverse the order. Your original file does not change.
Common questions
Why did only one column get sorted?
Only one column was selected. Click one cell inside the table, or select every column, before you sort.
Can I return to the original order after sorting?
Only if you add a numbered column (1, 2, 3 and so on) before you sort. Sort by it later to restore the order.
Why are my numbers sorted as 1, 10, 2?
They are saved as text. Convert them to numbers and the sort will be correct.
Related guides
Check its quality score and clean it in your browser. Free, no signup, and your file is never uploaded.
Try DataGenius BI