keepcalculator

06 Numbers and Powers

Sort by One Column? How to Sort Data in Excel

Card No. 06·52272 · Updated · Standard formula, shown below

Sorting by one column in Excel arranges your data rows based on the values in a single column, either alphabetically, numerically, or by date. You can do this in a few clicks using the Sort & Filter buttons on the Data tab, or the right-click context menu. This guide explains the different ways to sort by one column, what to watch out for, and how to avoid common mistakes.

What Does “Sort by One Column” Mean in Excel?

In spreadsheet programs like Microsoft Excel or Google Sheets, sorting by one column means reordering entire rows based on the values in that column. For example, if you have a list of employees with columns for Name, Department, and Salary, sorting by the Salary column will rearrange all rows so that the lowest (or highest) salary appears at the top, while keeping each employee’s name and department with their correct salary.

This is different from sorting by multiple columns (e.g., first by Department, then by Salary within each department). Single-column sorting is simpler and often all you need for basic organization.

How to Sort by One Column – Step by Step

Here are the most common methods in Excel (the same steps work in Google Sheets with minor differences):

Method 1: Using the Sort Buttons (Quickest)

  1. Click any cell inside the column you want to sort by. Do not select the entire column – just one cell is enough.
  2. Go to the Data tab on the ribbon.
  3. Click the A→Z button to sort ascending (smallest to largest, A to Z, earliest to latest).
  4. Click the Z→A button to sort descending (largest to smallest, Z to A, latest to earliest).

Excel automatically detects the range of data around the selected cell and sorts all rows together. If your data has a header row (like “Name” or “Salary”), Excel usually recognizes it and keeps it at the top.

Method 2: Using the Right-Click Menu

  1. Right-click any cell in the column you want to sort by.
  2. Choose Sort from the context menu.
  3. Select either Sort A to Z or Sort Z to A.

This works exactly like the ribbon buttons and is convenient when you are already working with the mouse.

Method 3: Using the Sort Dialog Box (More Control)

  1. Click any cell in your data range.
  2. Go to the Data tab and click Sort (the icon with an A and Z and a small arrow).
  3. In the dialog box, choose the column you want to sort by from the “Sort by” drop-down.
  4. Choose what to sort on (values, cell color, font color, or cell icon) and the order (A to Z, Z to A, or custom list).
  5. Click OK.

The dialog box also lets you decide whether your data has a header row. If you check “My data has headers,” the header row is excluded from the sort.

Common Mistakes and How to Avoid Them

Sorting is easy, but it can be destructive if done incorrectly. Here are the most frequent errors:

  • Selecting only one column before sorting. If you highlight just column A and then click Sort, Excel will sort that column independently, breaking the relationship with other columns. Always click a single cell inside the data range, or select the entire range including all columns.
  • Not having a header row. If your data has no headers, Excel may sort the first row along with the rest. Use the Sort dialog box and uncheck “My data has headers” if that is the case.
  • Hidden or filtered rows. Sorting only affects visible rows when filters are active. If you have filters on, you may need to clear them first.
  • Merged cells. Sorting with merged cells can cause errors or unexpected results. Unmerge cells before sorting.
  • Numbers stored as text. If a column contains numbers but some are stored as text (often indicated by a green triangle in the corner), sorting may put them in the wrong order. Convert text to numbers using the “Text to Columns” feature or the VALUE function.

Sorting by Date or Custom Lists

Excel treats dates as numbers, so sorting by a date column works the same as sorting numbers. However, if your dates are entered as text (e.g., “Jan 5, 2025”), they will sort alphabetically, not chronologically. To fix this, convert the text to real dates using the DATEVALUE function or the Text to Columns wizard.

For custom orders (like sorting by weekday name in the correct order – Monday, Tuesday, etc.), use the Sort dialog box and choose “Custom List” from the Order drop-down. Excel has built-in lists for days of the week and months, and you can create your own.

Sorting in Google Sheets vs. Excel

The steps are nearly identical in Google Sheets:

  • Right-click a cell and choose “Sort sheet A→Z” or “Sort sheet Z→A” – this sorts the entire sheet by that column.
  • Alternatively, use “Sort range” from the Data menu to sort only a selected range.

One key difference: in Google Sheets, the “Sort sheet” option sorts all columns together, while “Sort range” only sorts the selected range. In Excel, the behavior is more automatic – clicking a cell and sorting will always expand to the contiguous data range around it.

When to Use Multi-Column Sorting Instead

Single-column sorting is fine when you only care about one attribute. But if you need to group data by one column and then order within each group, you need multi-column sorting. For example, sorting by Department (A→Z) and then by Salary (largest to smallest) within each department requires two sort levels. In Excel, you can add multiple levels in the Sort dialog box. The same is true in Google Sheets using “Add another sort column.”

Multi-column sorting is essential for hierarchical data like sales by region and then by product, or students by grade and then by name. If you try to do this with single-column sorts, you will lose the grouping.

Frequently Asked Questions

Why does my sort mess up the rest of the row?

This happens when you select only one column before sorting. Excel then sorts that column independently, leaving the other columns in their original order. Always click a single cell inside the data range (not a column header) so Excel automatically selects the entire contiguous block of data.

How do I sort by a column but keep the header row at the top?

Excel usually detects the header row automatically. If not, use the Sort dialog box and check the “My data has headers” option. This tells Excel to exclude the first row from the sort. In Google Sheets, the “Sort sheet” option always keeps the first row as a header if it is formatted as one.

Can I sort by a column that has blank cells?

Yes. Excel places blank cells at the bottom when sorting ascending, and at the top when sorting descending. If you need blanks to appear in a specific position, you may need to fill them with a placeholder value or use a helper column.

What is the difference between sorting and filtering?

Sorting rearranges the order of rows. Filtering hides rows that do not meet a condition. You can combine both – filter to show only certain rows, then sort the visible ones. Note that sorting with filters active only sorts the visible data.

How do I undo a sort if I make a mistake?

Press Ctrl+Z (or Cmd+Z on Mac) immediately after sorting to undo it. If you have closed and reopened the file, the sort is permanent unless you saved a backup. For important data, consider copying the sheet or saving a version before sorting.

Can I sort by a column in a table without affecting other tables on the same sheet?

Yes. If you convert your data to an Excel Table (Ctrl+T), sorting within that table only affects the table’s rows. Similarly, in Google Sheets, you can use the “Sort range” option on a specific range instead of sorting the entire sheet.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →