The Sort guide
Click one cell in the column you want to sort by, then Data → Sort. Excel finds the whole table around that cell, keeps the header row where it is, and moves each row as a unit, so names stay next to their own numbers.
The safe way
- Click any single cell in the column to sort by, for example a sales figure.
- On the Data tab, press Sort A→Z (smallest first) or Sort Z→A (largest first). On numbers Excel labels them "Smallest to Largest" and "Largest to Smallest".
With one cell selected, Excel works out where the table starts and ends (the block of filled cells around it), spots the header row and sorts whole rows by the column you clicked in.
How rows break
Select just the Sales column and sort, and only that column moves. The names and regions stay where they were, so every rep now has someone else's number. Real Excel warns you with a "Sort Warning" box and offers to expand the selection; if you click past it, the damage is done and only Undo fixes it. That's why the habit is: one cell, not a column.
Sort by more than one column
To sort by region and then by sales inside each region, use Data → Sort (the dialog), add a level for each column, and put the main one first. Sorting twice with the quick buttons also works if you sort by the second key first.
Check it worked
- The header row is still on row 1.
- Pick one row you remember from before and check its values still belong together.
- An empty row in the middle stops the table: rows below it aren't sorted. Remove the gap or select the whole table first.
FAQ
- How do I sort in Excel and keep rows together?
- Click one cell in the column you want to sort by, then use Sort on the Data tab. Excel sorts the whole table by that column and moves complete rows.
- Why did sorting mix up my data?
- Probably only one column was selected, so only that column was sorted. Undo, click a single cell in the table and sort again.
- How do I sort largest to smallest in Excel?
- Click a cell in the number column and press Sort Z to A on the Data tab. On numbers it sorts from largest to smallest.
- Why is my header row sorted into the data?
- Excel didn't recognise it as a header, often because you selected the whole range including it. Use the Sort dialog and tick "My data has headers", or click one cell and let Excel find it.
This task is in the timed office and admin and basic Excel practice tests. What Excel interview tests check






























































