Course / Sort and filter

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:

In Excel, these are on the Data tab: Sort A to Z, Sort Z to A, Sort and Filter.

Steps

  1. 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).

  2. 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).

  3. 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

Previous: Highlight a whole row with a formula · Next: Sort by two columns