Excel tutorial
/

Data analysis

Beginner

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.

Книга1 - Excel
—☐✕
fx
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 000
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 000
8
Готово
The starting table: sales were entered in no particular order

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.

Книга1 - Excel
—☐✕
D3fx2250000
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 0001
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 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 Главная → Сортировка и фильтр.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Получить данныеОбновить все
Получить данные
СортировкаФильтр
Сортировка и фильтр
Текст по столбцамУдалить дубликатыПроверка данных
Работа с данными
D3fx2250000
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 000
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 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.

Книга1 - Excel
—☐✕
D2fx2250000
ABCDE
1ProductCityQtyAmount
2RiceSamarkand252 250 000
3FlourBukhara301 650 000
4TeaTashkent401 200 000
5SugarTashkent60780 000
6OilSamarkand18540 000
7BreadBukhara120480 000
8
ГотовоСреднее: 1150000Количество: 6Сумма: 6900000
The biggest sale — rice, 2,250,000 soum — is now in the first row

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

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Получить данныеОбновить все
Получить данные
СортировкаФильтр
Сортировка и фильтр
Текст по столбцамУдалить дубликатыПроверка данных
Работа с данными
B2fxTashkent
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 000
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 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.

Книга1 - Excel
—☐✕
B2fxTashkent
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 000
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 000
8
ГотовоСреднее: 575024,4167Количество: 28Сумма: 6900293

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.

Книга1 - Excel
—☐✕
B2fxTashkent
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 000
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 000
8
ГотовоСреднее: 575024,4167Количество: 28Сумма: 6900293

4

Click OK. Cities are in alphabetical order, and within each one the biggest sale is on top.

Книга1 - Excel
—☐✕
fx
ABCDE
1ProductCityQtyAmount
2FlourBukhara1301 650 0002
3BreadBukhara120480 000
4RiceSamarkand252 250 000
5OilSamarkand18540 000
6TeaTashkent401 200 000
7SugarTashkent60780 000
8
Готово
1 — first level (City, A→Z), 2 — second level (Amount, largest first)
Книга1 - Excel
—☐✕
D1fxAmount
ABCDE
1ProductCityQtyAmount
2TeaTashkent401 200 000
3RiceSamarkand252 250 000
4SugarTashkent60780 000
5FlourBukhara301 650 000
6OilSamarkand18540 000
7BreadBukhara120480 000
8
ГотовоСреднее: 1150000Количество: 7Сумма: 6900000
Only column D is selected, so Excel warns you. The right choice: Expand the selection

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, use SORTBY.
Книга1 - Excel
—☐✕
D2fx=СОРТ(A2:B5;2;-1)
ABCDEF
1EmployeeSalaryEmployeeSalary
2Aziz6 500 000Dilnoza8 200 000
3Dilnoza8 200 000Malika7 100 000
4Javohir5 400 000Aziz6 500 000
5Malika7 100 000Javohir5 400 000
6
Готово
One formula spills the whole sorted table into D2:E5; 2 is the Salary column, -1 means descending

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.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1ProductCityQtyAmount
2TeaTashkent401200000
3RiceSamarkand252250000
4SugarTashkent60780000
5FlourBukhara301650000
6OilSamarkand18540000
7BreadBukhara120480000
8
9
10
11
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

40 / 154