Sorting puts your data in order so you can find patterns and spot problems

Sorting in Excel rearranges your rows based on the values in one or more columns. If you have a list of rent payments by date, sorting by date puts them in order from earliest to latest. If you have tenant names and move-in dates, you can sort by name alphabetically or by date chronologically. Excel keeps each row together as it sorts — your tenant's name stays matched to their move-in date — so you don't scramble your data.

You sort data when you need to see it in a specific order: to find the highest or lowest value, to group similar items together, to spot missing information, or to prepare data for a report. Sorting is different from filtering, which hides rows you don't want to see. Sorting actually rearranges the rows.

Key Takeaways

  • Select all your data including headers before you sort, or Excel will sort only the column you clicked and scramble your rows.
  • Sort by one column for straightforward ordering (like dates or names), or by multiple columns to break ties (like all tenants sorted by move-in date, then by name within each date).
  • Use Data > Sort from the menu to open the sort dialog, which shows you exactly what will happen before you click OK.
  • If you sort by mistake, press Ctrl+Z when ready to undo and restore your original order.

Select your data before you sort

The most common mistake is clicking a single cell and then sorting. Excel will sort only that column and leave the others in place, which scrambles your data. Instead, select the entire range that includes all your columns and all your rows of data.

Click the cell in the top-left corner of your data (usually a header like "Name" or "Date"). Hold Shift and click the cell in the bottom-right corner of your data. This selects the whole rectangle. If your data has headers in the first row — which it should — make sure the headers are included in your selection.

A faster way: click any cell inside your data, then press Ctrl+A. Excel will select all the data it recognizes as connected. Check that the selection includes everything you want to sort, then proceed.

Sort by a single column using the Data menu

With your data selected, go to the Data menu at the top of the screen and click Sort. A dialog box opens showing your column headers and sort options.

Under "Sort by", choose the column you want to sort on from the dropdown. For example, if you want to sort by date, select the date column. Below that, choose Ascending (A to Z, or earliest to latest) or Descending (Z to A, or latest to earliest). Then click OK.

Excel will rearrange all your rows so that the column you chose is in order. Every row moves as a unit, so each person's information stays together.

Sort by multiple columns to handle ties

Sometimes you want to sort by one column, but when two rows have the same value in that column, you want them sorted by a second column. For example, you might sort all your tenants by move-in date, but within each date, sort them alphabetically by last name.

Select your data and open Data > Sort. Under "Sort by", choose your first column (move-in date). Then look for "Then by" below it and choose your second column (last name). You can add a third "Then by" if you need it. Set each one to Ascending or Descending, then click OK.

Excel sorts by the first column, then uses the second column to break ties, then the third if needed. The result is organized and predictable.

Sort numbers and dates correctly

Excel usually recognizes whether a column contains numbers, dates, or text, and sorts accordingly. Numbers sort from smallest to largest (or largest to smallest). Dates sort from earliest to latest. Text sorts alphabetically.

If a column looks like numbers but Excel treats it as text, the sort will look wrong — for example, 9 might appear before 10 because it's comparing characters, not values. This usually happens when numbers are stored with extra spaces or formatting. To fix it, select the column, go to Data > Text to Columns, and click Finish. This converts text-formatted numbers to real numbers. Then sort again.

Dates sometimes sort incorrectly if they're formatted as text instead of as actual dates. The same Text to Columns fix works for dates too.

Undo a sort if something goes wrong

If you sort and the result is not what you expected, press Ctrl+Z when ready. Excel will undo the sort and restore your data to the order it was in before. You can undo multiple times if you need to go back several steps.

This is why it's safe to experiment with sorting — you can always undo. If you've made other changes since the sort, undo will reverse those too, so work carefully if you've sorted and then edited data.

Sort a single column without scrambling the rest

Occasionally you want to sort one column without moving the others. This is rare and usually a mistake, but if you need it: select only that one column (not the whole data range), then go to Data > Sort. Excel will warn you that you haven't selected the entire range and ask if you want to expand the selection. Click "Continue with the current selection" to sort only that column. Your other columns will stay in their original order.

In most cases, you should let Excel expand the selection and sort the whole range together. Sorting a single column usually breaks your data.

Frequently Asked Questions

What's the difference between sort and filter?

Sort rearranges all your rows in a new order. Filter hides rows you don't want to see, but doesn't move anything. Use sort when you want to reorganize your data. Use filter when you want to look at only certain rows without changing the order.

Can I sort by color or by cell formatting?

Yes. Open Data > Sort, and instead of choosing a column name under "Sort by", choose "Cell Color" or "Font Color" from the dropdown. Excel will group cells by color. This is useful if you've color-coded your data by status or category, but it's slower than sorting by a column of text or numbers.

Will sorting change my formulas?

No. If a cell contains a formula, the formula stays in that cell when the row moves. The formula recalculates based on the new row it's in, so results may change, but the formula itself doesn't break. If you have formulas that reference specific rows by number, those references won't update when you sort.

How do I sort by the first letter only, or ignore capitals?

Excel's standard sort is case-insensitive, so "apple" and "Apple" sort together. To sort by first letter only or to customize the sort rules, you need to use Data > Sort > Options, but most spreadsheets don't need this. The default sort handles most cases correctly.

Can I sort just part of my data without sorting the rest?

You can select only the rows you want to sort (not including the header), then sort. But this is risky because it's straightforward to accidentally scramble your data. It's safer to sort your entire dataset, then manually rearrange rows afterward if you need to keep some rows in a fixed position.