Sort in Excel: A to Z, by number, by date, by two columns
Sorting rearranges rows in order. The one rule: click inside the data before you sort, never select a single column, or the columns come apart.
Sort by one column
- Click any cell in the column you want to sort by.
- Data › A→Z (or Z→A). For numbers that is smallest to largest; for dates, oldest to newest.
Whole rows move together. Headings stay at the top.
Sort by two columns (city, then name inside each city)
- Click inside the data. Data › Sort.
- Sort by: City, A to Z.
- Click Add Level. Then by: Name, A to Z. OK.
Check it worked
Pick one row you remember — Ana, 100, Pune. After sorting, Ana’s row still says 100 and Pune. If it doesn’t, press Ctrl + Z at once.
Put it back in the original order
Before sorting, add a column with 1, 2, 3… (type 1 and 2, select both, drag down). Sort by that column to restore.
Common mistakes
“Sort Warning: expand the selection?” — you selected one column. Choose Expand the selection so rows stay together.
Numbers sort wrong (1, 10, 2). They are text. Select them, click the warning icon › Convert to Number, sort again.
Headings got sorted in. In the Sort dialog tick My data has headers.