Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk9 min

How to Sort Data in Excel

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sorting is one of Excel’s fastest ways to turn a messy range into something you can scan: bring the latest dates to the top, group customers alphabetically, or rank records by revenue.

This guide shows you exactly how to sort in Excel with the UI you’ll see in most current versions, including multi-level sorts, custom lists, color/icon/font sorting, and the common traps that cause “wrong” results.

As an Amazon Associate I earn from qualifying purchases.

Why Sorting in Excel Matters (and what Excel does behind the scenes)

Excel sorts rows based on the sort keys you choose. If you sort a range without keeping related columns together, you can break row alignment (for example, names no longer match phone numbers).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When you use the built-in sort controls on a well-formed range or an Excel Table, Excel tries to apply the sort across the entire dataset so each row stays intact.

Prerequisites before you sort

  • Clear headers: Put column titles in the first row (e.g., Customer, Date, Revenue).
  • Keep data contiguous: Avoid blank rows/columns inside the dataset you want to sort.
  • Confirm formats: Dates should be real dates (not text), and numbers should be numeric.
  • Decide what to move: You usually want to move entire rows, not individual columns.

If your sheet has a header row and consistent columns, Excel’s sort dialog will typically offer the right option automatically.

Basic sort: one column, ascending or descending

For most tasks, start with a single-column sort. Example: sort Order Date from newest to oldest.

  1. Select any cell within your dataset (for example, in the Order Date column).
  2. Go to the Data tab.
  3. In the Sort & Filter group, click Sort A to Z (ascending) or Sort Z to A (descending).
  4. If prompted, choose whether your data has a header row (commonly My data has headers).

If you need more control, use Sort instead of the A-to-Z shortcuts.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sort with the Sort dialog (more control)

  1. Select one cell in the dataset.
  2. Go to Data > click Sort (not just A–Z).
  3. In Sort by, choose your column (e.g., Revenue).
  4. In Sort On, keep the default (usually Values).
  5. In Order, pick Smallest to Largest or Largest to Smallest.
  6. Click OK.

Sort multiple columns (data priority order)

Multi-column sorting is how you create predictable ordering when the primary key isn’t unique. Example: sort by Department, then within each department sort by Last Name, then by Hire Date.

  1. Select any cell in your dataset.
  2. Go to Data > Sort.
  3. Set Sort by to your primary column (e.g., Department).
  4. Set Order (e.g., A to Z).
  5. Click Add Level.
  6. Repeat for each additional column (e.g., Last Name A to Z, then Hire Date Oldest to Newest).
  7. Confirm My data has headers if shown.
  8. Click OK.

Excel applies the first sort level first, and uses the next levels only when values in the previous level match.

Sort left-to-right vs top-to-bottom

Excel typically sorts top-to-bottom by rows. If your “dataset” is laid out across columns (dates in columns, categories in rows), you may need left-to-right.

  1. Select your range.
  2. Go to Data > Sort.
  3. Look for Options (often a small button in the Sort dialog).
  4. Enable Sort left to right.
  5. Set Sort by to the column (or row, depending on layout) containing the values you want to drive the ordering.
  6. Pick Order and click OK.

If you can’t find “Sort left to right,” you may be sorting a single column selection instead of the full range—select everything first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Sort by Color, Cell Icon, or Font Color

If your sheet uses conditional formatting (for example, green/yellow/red statuses), you can sort based on those visual cues—without manually re-entering values.

  1. Select any cell in the dataset.
  2. Go to Data > Sort.
  3. Set Sort by to the column with the colored cells/icons.
  4. Under Sort On, choose one of:
  • Cell Color (sort by the fill color)
  • Font Color (sort by the text color)
  • Cell Icon (sort by icon indicators)
  1. In Order, select the color/icon priority (Excel lists the colors/icons it detects).
  2. Click OK.

Gotcha: if conditional formatting rules change which cells get which color, the sort result will change too—so archive the logic if you need reproducibility.

Sort with custom lists (e.g., Low/Medium/High)

Custom lists are perfect when alphabetical order isn’t meaningful. Example: you want Low < Medium < High.

  1. Select your dataset.
  2. Go to Data > Sort.
  3. In Sort by, choose your priority column (e.g., Priority).
  4. In Order, look for a dropdown that includes Custom List.
  5. If you don’t see it, click Options or open the custom lists setting:

Depending on version, the custom lists UI is typically under:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • File > Options > Advanced > Edit Custom Lists
  1. Create your list (e.g., Low, Medium, High).
  2. Return to the sort dialog and choose Custom List: Low, Medium, High.
  3. Click OK.

Sorting text, numbers, dates, and mixed data correctly

Excel sorts based on data types. If values are stored as text, “10” can appear before “2” in ascending numeric sorts.

When numbers behave like text

Symptoms: numeric values sort alphabetically (e.g., 1, 10, 100, 2). Fix by converting to numbers.

  1. Select the affected column.
  2. Look for an error or conversion hint (top-left warning icon) in some versions.
  3. Or use a formula helper in a new column:

Common approach:

  • Use =VALUE(A2) to convert text to a number.
  • Copy down, then replace values with the new column.

When dates behave like text

If your dates were imported (CSV, copied from a website), they might be text. Sorting then looks “wrong” by year or month.

  • Try converting using =DATEVALUE(A2) (for text dates in recognizable format).
  • Or format the column as Date and re-check the stored values.

After conversion, redo the sort.

Case sensitivity and “equal” values

Most Excel sorts treat text case-insensitively. For truly stable sorting, include a secondary key (like an ID) as another sort level.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sorting with Excel Tables (best practice)

Excel Tables (created via Insert > Table) help prevent broken row alignment because Excel understands the structure.

  1. Click inside your dataset.
  2. Go to Insert > Table.
  3. Confirm My table has headers.
  4. Use the dropdown filter in the header you want to sort (e.g., click the Revenue header dropdown).
  5. Choose Sort Ascending or Sort Descending.

Tables also retain sort behavior when you add new rows—Excel expands the table automatically.

Sort only part of a range (and why it’s risky)

Sometimes you want to sort just a single column (like sorting a list of tags). But if you do it to part of a row-based dataset, you’ll scramble relationships.

Excel warns you with a prompt like Expand the selection (wording varies). Here’s how to choose safely:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • If you’re sorting a table of records: choose Expand the selection so Excel moves all related columns together.
  • If you’re sorting a standalone list: ensure there are no dependent columns and select only that list.

If the prompt is not shown, it often means your selection doesn’t match Excel’s idea of a contiguous range—select the entire dataset including headers.

Copying a sorted view vs permanently rearranging data

Sorting rearranges rows in place. If you need the original order (e.g., chronological log), create a copy first.

  1. Select the dataset.
  2. Copy (Ctrl+C on Windows, Cmd+C on Mac).
  3. Paste into a new area or new sheet.
  4. Sort the copy.

Best practice for auditability: keep an explicit OriginalOrder column (or an ID) so you can restore order by sorting on that field.

Filtering vs sorting: when to use each

Filtering selects which rows you see; sorting changes the order of rows you see (and usually all rows in the dataset).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Filter when you need to focus on a subset (e.g., only “Closed Won” deals).
  • Sort when you need an ordered ranking or timeline across the dataset.

You can combine them: filter down to a subset, then sort that subset by date, amount, or status.

Rank #4
Excel Shortcut Keys Poster for Analysts Copy Paste Filter Sort Pivot Table Efficiency Chart Office Wall Print(Unframed,08x12inch(20x30cm))
  • We have reserved a 0.6in (1.5cm) white margin for you, which is convenient for you to frame with a photo frame
  • Canvas posters are different from paper posters in that they will not deteriorate due to environmental factors such as humidity.
  • Because everyones monitor is different, the poster may have a slight color difference
  • Let it enhance your art space and decorate your home
  • If you like the same series of posters, welcome to click on my shop to buy

Common mistakes and how to fix them

  • Forgetting headers: If headers are included in the sort range, Excel may treat “Customer” as a value and move it. Fix by sorting with My data has headers enabled or re-selecting the correct range.
  • Sorting only one column: This breaks row alignment. Fix by expanding selection or converting the range to an Excel Table.
  • Mixing text and numbers: Fix by converting data types (use VALUE / DATEVALUE) before sorting.
  • Inconsistent date formats: Some rows may store dates as text. Normalize first, then sort.
  • Assuming stable order: When primary keys tie, results can vary. Add a secondary key (like an ID).
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting: when the sort result looks wrong

If sorting doesn’t produce the ordering you expect, don’t guess—verify the data types and what Excel is actually sorting.

1) Check the underlying values

Click a few “misplaced” cells and compare their contents. If values have leading/trailing spaces (common with copied text), they can sort unexpectedly.

  • Trim spaces with =TRIM(A2) in a helper column.
  • Replace values with the trimmed results.

2) Confirm Excel recognizes dates as dates

Try formatting the column as Date. If values don’t change meaningfully, they might be text.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Convert with =DATEVALUE(A2) (or your relevant conversion approach).
  • Re-run the sort.

3) Use “Sort On: Values” (not something else)

In the Sort dialog, ensure Sort On is set to Values. If it’s set to something like cell color and the formatting is inconsistent, the ordering won’t match numeric expectations.

4) Remove blank rows inside the dataset

Blank rows can cause Excel to treat your selection as separate blocks. Select again, or clean up internal blanks before sorting.

5) Switch to an Excel Table

If you keep hitting selection/expansion issues, converting your range to an Excel Table usually fixes the alignment problem permanently.

Windows vs Mac: what changes in the UI

Sorting concepts stay the same, but buttons and dialog layout differ slightly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows (Excel for Microsoft 365/2019/2021)

Sorting is typically centered around the Data tab’s Sort dialog and header dropdowns inside Tables.

  1. Go to Data > Sort.
  2. Choose Sort by, Order, and add levels as needed.
  3. Use Options if you need left-to-right or other behaviors.

macOS (Excel for Microsoft 365)

macOS Excel keeps the same logical options. Look for the Sort dialog under the Data tab and for dropdown sort controls within Tables.

  1. Select a cell in the dataset or a column inside an Excel Table.
  2. Use Data > Sort to open the dialog.
  3. Add levels and set My data has headers if available.

FAQs

Can I sort by two different criteria in Excel?

Yes. Use Data > Sort and click Add Level to create a multi-column sort priority.

Why does my Excel sort alphabetize numbers?

Most often, your numbers are stored as text. Convert using =VALUE() (and ensure the column is numeric), then sort again.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I sort dates correctly when some are blank?

Blanks are valid values for sorting rules. If you want blanks at the bottom, keep Smallest to Largest or add a secondary key like an ID to stabilize ties. For custom behavior, consider converting blank dates to a placeholder date in a helper column.

What if my dataset has merged cells?

Merged cells often break reliable sorting. Unmerge the cells, copy the content into separate cells as needed, and then sort.

Is there a way to sort without permanently changing the sheet?

Sorting is destructive in place. If you need the original order, copy the data to a new sheet first, or sort on a copy and keep the unsorted version intact.

Bottom Line

Sorting in Excel is straightforward when your data types are correct and Excel can move entire rows as a unit. For the most reliable results, use header rows, avoid blanks inside datasets, and convert your range to an Excel Table.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the ordering looks wrong, treat it like a diagnosis: confirm what Excel is actually sorting (values vs colors), fix text-to-number/date issues, and add a secondary key to make ordering stable.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.