Skip to content
Appcyclopedia
Microsoft Excel guide

How to sort data in Excel

· 1 min task · Tested

By

Elias Brandt writes about marketing, email and analytics tools for Appcyclopedia, working on a ThinkPad X1 Carbon Gen 10 and a Galaxy S25.

  • Windows
  • macOS
  • Web

Short answer

Click any cell in the column you want to sort by. On the Data tab, select Sort A to Z or Sort Z to A. For numbers and dates, the same buttons sort smallest to largest or oldest to newest. Excel moves whole rows, so each row’s data stays together.

If Excel asks, choose Expand the selection: sorting only one column would separate it from the rest of its row.

Below: sorting one column, sorting by several columns, headers, and sorting by colour.

How to put Excel data in order

To sort data in Excel, pick the column to sort by and use the Data tab. The first group sorts by one column, the second by several.

  1. Sort by one column

    Click a cell in the column to sort by

    Click any single cell in the column you want to order the data by, such as a name or date column. Do not select the whole column; Excel finds the rest of the table itself.

  2. Select Sort A to Z or Sort Z to A on the Data tab

    On the Data tab, in the Sort & Filter group, select Sort A to Z for ascending or Sort Z to A for descending. Numbers sort smallest to largest, dates oldest to newest. Every row moves together.

  3. Choose Expand the selection if Excel asks

    If Excel warns that there is data next to your selection, choose Expand the selection and select Sort. Sorting the current selection only would mismatch rows.

  4. Sort by several columns

    Open Sort on the Data tab

    Click a cell in the data and select Sort on the Data tab. The Sort window opens. Tick My data has headers if row 1 holds column names, so it stays at the top.

  5. Add a level for each column

    Under Column, choose the first column to sort by and the order. Select Add Level for the next column, such as first name after surname. Levels higher in the list are sorted first. Select OK.

  6. Sort by colour if you highlight cells

    In the Sort window, change Sort On from Cell Values to Cell Color or Font Color, choose the colour and whether it goes On Top or On Bottom. Highlighted rows gather together.

A list of club members to put in order: click a cell in the Surname column and select Sort A to Z. For members with the same surname, open Sort, add a second level for First name, and Excel orders them by surname, then first name.

Click a single cell, not the whole column, before sorting: Excel then finds the full table and keeps every row intact.

More about Microsoft Excel

Microsoft’s spreadsheet app, free on the web with a Microsoft account.

If Excel sorts your data wrongly

Rows got mixed up after sorting

Only one column was sorted. Press Ctrl+Z to undo, click a single cell and sort again, choosing Expand the selection if asked.

The header row moved into the data

Excel did not recognise it as a header. Open Sort and tick My data has headers.

Numbers sort in the wrong order

They are stored as text, so 10 comes before 9. Convert them to numbers with the warning icon next to the cells, then sort again.

Sort options in Excel

Excel can sort by values, colours and more than one column at once.

You wantUseWhere
Alphabetical or by numberSort A to Z or Z to AData tab
By two or more columnsSort, then Add LevelData tab
Highlighted rows togetherSort On: Cell ColorSort window
Keep the header in placeMy data has headersSort window

Use the A to Z buttons for quick sorts and the Sort window whenever more than one column matters.

Keeping the original order

Sorting rearranges rows for good, apart from undo. If the original order matters, such as the order entries came in, add a column numbered 1, 2, 3 before you sort. Sorting by that column later puts everything back.

What to do after sorting

Check a few rows to make sure each still matches, and save. If something looks wrong, undo straight away.

Click one cell, choose Sort A to Z or Z to A, and use Sort for several columns. To total a sorted list, the guide to adding up a column in Excel covers AutoSum.

Sorting in Excel, answered

Will sorting mix up my rows?
Not if you click a single cell and let Excel expand the selection. It moves whole rows so the data stays matched.
How do I sort by two columns?
Open Sort on the Data tab, choose the first column, select Add Level, and choose the second. Excel sorts by the first, then the second.
Can I undo a sort?
Yes, with Ctrl+Z straight away. To keep the original order for later, add a column numbering the rows before you sort.
What is the difference between sort and filter?
Sort changes the order of all rows. Filter hides rows that do not match, without changing the order of the rest.

Share this guide

Was this guide helpful?

Test log

Followed the steps? Tell us how it went on your device. Entries appear here after we check them.

  1. Worked Every step, start to finish · Elias Brandt and Marta Kowalczyk Team
I tested this
How did it go?

Steps performed and confirmed 24 days ago

When you need this

To put an Excel list in order, click a cell in the column to sort by and choose Sort A to Z or Z to A on the Data tab. The Sort window handles several columns at once.

Describes
Excel for Microsoft 365 on Windows · Excel for the web
Takes
A few seconds
Platforms
Windows · macOS · Web
Published
25 October 2026
Facts checked
24 October 2026

Steps repeated and verified by and on

  • Elias Brandt: the Windows and web steps on a ThinkPad X1 Carbon (Windows 11 Pro).
  • Marta Kowalczyk: the Mac steps on a MacBook Air (macOS 27.0.1).

Next

excelsortinggetting started