How to sort in Excel: A to Z, largest to smallest and multi-level sort
Sort Excel data by one or several columns, use Custom Sort and the SORT function, and avoid the one mistake that silently scrambles your table.
Sorting puts rows in order by a chosen column: names alphabetically, amounts from largest to smallest, dates from oldest to newest. A shop owner instantly sees the best-selling product, an accountant the highest salary, a teacher the top grade.
The key point: when sorting, Excel moves the whole row. A product’s name, city and amount always travel together. Do it right and the table falls into order; do it wrong and the data gets silently mixed up.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 000 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
Quick sort by one column
1
Click any single cell in the column you want to sort by (for example, D3 in the Amount column). There is no need to select the whole column — Excel finds the table’s edges by itself.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 0001 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
2
Open the Данные tab and click Сортировка от Я до А — amounts are sorted from largest to smallest. For the opposite order, use Сортировка от А до Я. The same commands live under Главная → Сортировка и фильтр.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 000 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
3
Check the result: each product moved together with its city and quantity. The header row stayed in place — Excel detected it automatically.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Rice | Samarkand | 25 | 2 250 000 | |
| 3 | Flour | Bukhara | 30 | 1 650 000 | |
| 4 | Tea | Tashkent | 40 | 1 200 000 | |
| 5 | Sugar | Tashkent | 60 | 780 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
What “A to Z” really means
There is one button, but the result depends on the data type in the column:
- Text — alphabetically (A to Z or the reverse).
- Numbers — Smallest to Largest or the reverse.
- Dates — Oldest to Newest or the reverse.
- Blank cells — always end up at the bottom, in both directions.
In a mixed column, ascending order is: numbers first, then text, then FALSE/TRUE, then errors, and blanks last.
Multi-level sort (Custom Sort)
1
Click any cell in the table and choose Данные → Сортировка. The Sort dialog opens (Alt + A + S + S).
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 000 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
2
Make sure My data has headers is checked — then the list shows column names like City and Amount. Set Sort by to City, Sort On to Cell Values and Order to A to Z.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 000 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
3
Click Add Level and set the second level: Then by Amount, Order Largest to Smallest. Excel first groups rows by city, then orders amounts from largest to smallest within each city.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 000 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
4
Click OK. Cities are in alphabetical order, and within each one the biggest sale is on top.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Flour | Bukhara1 | 30 | 1 650 0002 | |
| 3 | Bread | Bukhara | 120 | 480 000 | |
| 4 | Rice | Samarkand | 25 | 2 250 000 | |
| 5 | Oil | Samarkand | 18 | 540 000 | |
| 6 | Tea | Tashkent | 40 | 1 200 000 | |
| 7 | Sugar | Tashkent | 60 | 780 000 | |
| 8 |
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | |
| 2 | Tea | Tashkent | 40 | 1 200 000 | |
| 3 | Rice | Samarkand | 25 | 2 250 000 | |
| 4 | Sugar | Tashkent | 60 | 780 000 | |
| 5 | Flour | Bukhara | 30 | 1 650 000 | |
| 6 | Oil | Samarkand | 18 | 540 000 | |
| 7 | Bread | Bukhara | 120 | 480 000 | |
| 8 |
4 more reasons a sort goes wrong
- A blank row or column. Excel assumes the table ends at a blank row, so everything below it stays unsorted. Remove blank rows or select the whole table yourself.
- Merged cells. If the table contains Merge & Center, Excel refuses with a message that all merged cells must be the same size. Unmerge them.
- Numbers stored as text. They are sorted separately, as text: “100” comes before “25”. Convert them to numbers first.
- Uzbek letters. Excel sorts by the Latin alphabet: “Sh” lands between “Se” and “Si”, and “O‘” next to “O” — not at the end as in the Uzbek alphabet.
Pro level: your own order, sorting by color and by formula
- Custom List. Orders like “High, Medium, Low” or “January, February, March” are not alphabetical. In the Sort dialog choose Order → Custom List... and type the values in the order you need.
- By color. Set Sort On to Cell Color or Font Color to bring colored rows to the top — a perfect match for conditional formatting.
- Left to right. Options... → Sort left to right — for tables where months run across columns.
- The SORT function (Excel 2021/365).
=СОРТ(A2:B5;2;-1)leaves the source untouched, returns a sorted copy next to it and updates itself when the data changes. For several columns, useSORTBY.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee | Salary | Employee | Salary | ||
| 2 | Aziz | 6 500 000 | Dilnoza | 8 200 000 | ||
| 3 | Dilnoza | 8 200 000 | Malika | 7 100 000 | ||
| 4 | Javohir | 5 400 000 | Aziz | 6 500 000 | ||
| 5 | Malika | 7 100 000 | Javohir | 5 400 000 | ||
| 6 |
Try it in the simulator
Sort the table by Amount from largest to smallest: select one cell in column D and click Данные → Сортировка от Я до А. Then select a cell in the City column, sort A to Z, and check that every product kept its own amount.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Product | City | Qty | Amount | ||||||||||||||||||||
| 2 | Tea | Tashkent | 40 | 1200000 | ||||||||||||||||||||
| 3 | Rice | Samarkand | 25 | 2250000 | ||||||||||||||||||||
| 4 | Sugar | Tashkent | 60 | 780000 | ||||||||||||||||||||
| 5 | Flour | Bukhara | 30 | 1650000 | ||||||||||||||||||||
| 6 | Oil | Samarkand | 18 | 540000 | ||||||||||||||||||||
| 7 | Bread | Bukhara | 120 | 480000 | ||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.