Sort a table
Put a table in order by name, by price and by stock, with whole rows moving together. Beginner · 3 min · Sort A to Z, Sort Z to A, Whole rows
Sorting puts a table in order by one of its columns: names from A to Z, prices from high to low.
You don't select the table. You click one cell in the column to sort by, then a sort button. Excel finds the edges of the table by itself, keeps the row of headings on top, and moves whole rows, so every product keeps its own price and stock.
There are two buttons, and their names fit text and numbers alike:
- Sort A to Z is also smallest to largest, and oldest to newest.
- Sort Z to A is also largest to smallest, and newest to oldest.
In Excel, these are on the Data tab: Sort A to Z, Sort Z to A, Sort and Filter.
Steps
The products are in no order at all. Click any cell in the Product column, such as
A2, then Sort A to Z (the A→Z button in the toolbar).Which products cost the most? Click a cell in the Price column, such as
C2, then Sort Z to A (the Z→A button in the toolbar).What is about to run out? Click a cell in In stock, such as
D2, then Sort A to Z (the A→Z button in the toolbar) to put the smallest numbers first.
Remember
- Click one cell in the column to sort by, then Sort A to Z or Sort Z to A.
- Whole rows move together; the headings stay on top.
- A to Z is smallest first; Z to A is largest first.
- Each sort replaces the one before. To get back, undo with Ctrl+Z.
Previous: Highlight a whole row with a formula · Next: Sort by two columns