How To Sort Columns In Excel

A practical step-by-step guide to how to sort columns in excel, including preparation, instructions, common issues, tips, and next steps.

Published 2026-06-29 ยท Updated 2026-07-24

How To Sort Columns In Excel cover image

How To Sort Columns In Excel

This guide explains how to approach how to sort columns in excel, including the preparation, practical steps, common mistakes, and final checks that help you finish with confidence.

5-10 minutes Time needed
Easy Difficulty
Scrambled data Watch out for

Before You Start

Check first: Always create a backup copy of your Excel file before performing any major sort. This ensures you can easily revert to your original data if anything goes wrong during the sorting process.

Step-by-Step Instructions

Quick Reference

Common Problems When You Sort Columns In Excel

Even with clear instructions, sorting data in Excel can sometimes lead to unexpected results. Here are some common issues and how to fix them:

Problem: Only One Column Sorted, Other Data Scrambled

This is the most frequent and most frustrating problem. You wanted to sort your whole table by one column, but only that column moved, leaving the rest of your data a mess.

  • Why it happens: You likely selected only the column you wanted to sort by, instead of the entire table of related data. When Excel asks "What do you want to do?", you chose "Continue with the current selection."
  • The Fix: Immediately use Ctrl + Z (Windows) or Cmd + Z (Mac) to undo the sort. This is crucial. Then, re-select your entire data range (e.g., using Ctrl + A) and follow the steps again, ensuring you click the main "Sort" button and let Excel expand your selection or confirm "My data has headers."

Problem: Sort Order Seems Incorrect (e.g., Numbers "1, 10, 2" instead of "1, 2, 10")

You sorted a column of numbers, but they appear in an illogical order.

  • Why it happens: Excel might be treating your numbers as text instead of actual numbers. Text sorting works character by character (so "10" comes before "2" because "1" comes before "2").
  • The Fix: Select the problematic column. Go to the Home tab and in the "Number" group, change the format dropdown from "Text" or "General" to Number. You might need to re-enter the numbers or use a "Text to Columns" feature if they are stuck as text. Once formatted correctly, try sorting again.

Problem: Blank Rows or Unexpected Data Appear at the Top or Bottom

After sorting, you find empty rows or irrelevant information mixed into your main data.

  • Why it happens: Your initial selection included blank rows or parts of the spreadsheet that weren't part of your core data table.
  • The Fix: Undo the sort. Carefully re-select only the exact range of cells that contain your relevant data, making sure to avoid any blank rows or separate tables. Then, proceed with the sort.

Problem: Header Row Got Sorted Along with the Data

Your column titles (like "Name," "Price") are now mixed into the sorted data, not staying at the top.

  • Why it happens: In the "Sort" dialogue box, you likely did not check the "My data has headers" box, or Excel didn't correctly detect your headers.
  • The Fix: Undo the sort. Re-open the "Sort" dialogue box, and make sure the "My data has headers" checkbox is firmly ticked. If your headers are not in the very first row of your selection, you might need to adjust your selection to include them correctly.

Advanced Tips for How To Sort Columns In Excel

Once you're comfortable with basic sorting, you can explore more powerful features to make your data management even easier and more flexible.

Convert Your Data to an Excel Table

This is one of the most powerful tips for anyone working with data in Excel. Converting your data into an official "Table" (not just a range of cells that looks like a table) offers many advantages, including easier sorting.

  • How to do it: Click anywhere within your data. Go to the Insert tab and click Table. Excel will usually detect your data range and headers correctly. Click OK.
  • Why it helps: Once your data is a table, Excel automatically understands its boundaries and headers. You no longer need to manually select the entire range each time you sort. Small dropdown arrows will appear in your header cells. Clicking these arrows gives you quick access to sort options (A to Z, Z to A) for that specific column, and Excel will always keep all rows intact automatically.

Use Custom Lists for Specific Orders

Sometimes, alphabetical or numerical order isn't what you need. For example, you might want to sort T-shirt sizes as "Small, Medium, Large, X-Large" or product priority as "High, Medium, Low." Excel's Custom Lists allow you to define your own sorting sequences.

  • How to create a custom list: Go to File > Options > Advanced. Scroll down to the "General" section and click Edit Custom Lists.... In the "Custom Lists" dialogue box, you can type your list entries in order (one per line) and click "Add."
  • How to use it: When in the main "Sort" dialogue box, select your "Column," then under "Order," choose Custom List.... Select your created list from the options and click OK.

Sort by Cell Colour or Font Colour

If you've used conditional formatting or manually coloured cells to highlight certain data points, you can use these colours as a sorting criterion.

  • How to do it: In the "Sort" dialogue box, select your "Column." In the "Sort On" dropdown, choose either Cell Colour or Font Colour. Then, in the "Order" dropdown, you'll be able to select the specific colour you want to sort by, and whether you want cells with that colour at the top or bottom.
  • Why it helps: This is excellent for visually organising data, allowing you to group highlighted items quickly without changing their underlying values.

Perform a Case-Sensitive Sort

By default, Excel's sorting treats "Apple" and "apple" as the same. If you need to distinguish between uppercase and lowercase letters during a sort, you can enable case sensitivity.

  • How to do it: In the "Sort" dialogue box, click the Options... button. In the "Sort Options" dialogue box, check the Case sensitive box and click OK. Then proceed with your sort as usual.
  • Why it helps: Useful for specific data sets where capitalisation carries meaning, such as codes or proper nouns that need exact ordering.

How To Sort Columns In Excel FAQ

Q: Can I sort only part of a column?

A: Yes, you can, but it is generally very risky. If you select only a portion of a column and sort it, the cells you sorted will detach from their original rows. This will scramble your data, making the information meaningless. Only do this if you are absolutely certain the partial column has no related data in other columns.

Q: What's the difference between the "Sort A to Z" button and the full "Sort" dialogue box?

A: The "Sort A to Z" (or Z to A) buttons on the Data tab are quick sort options. They will attempt to sort your data based on the currently selected column, usually as the primary sort. However, they offer less control. The full "Sort" dialogue box (accessed by clicking the larger "Sort" button) gives you much more power. It allows you to define multiple sort levels, use custom lists, sort by colour, and set case-sensitive options, ensuring a more precise and safer sort, especially for complex data.

Q: My dates aren't sorting correctly. What's wrong?

A: The most common reason dates don't sort correctly is that Excel is treating them as text rather than actual date values. To fix this, first, ensure the column containing your dates is formatted as a "Date" type (Home tab > Number group dropdown). Also, make sure all dates are entered in a consistent and recognisable date format that Excel can understand (e.g., DD/MM/YYYY). If dates are entered inconsistently, Excel might not recognise them all as dates. Once formatted correctly, try sorting again.

Q: Can I undo a sort if I make a mistake?

A: Yes, absolutely! Immediately after sorting, if you realise you've made a mistake or the data looks scrambled, press Ctrl + Z (on Windows) or Cmd + Z (on Mac). This is the "Undo" command and will revert your spreadsheet to its state before the sort, allowing you to try again without losing your original data. This is why it's also helpful to make a backup before any major operation.

Final Checklist for How To Sort Columns In Excel

Before you consider your sorting task complete, quickly run through this checklist to ensure your data is perfectly organised and safe:

  • Backup: Did you make a backup copy of your original spreadsheet before you started sorting?
  • Selection: Is your entire related data range selected (or, if intentional, only the single column you meant to sort independently, understanding the risks)?
  • Headers: Is the "My data has headers" checkbox correctly ticked or unticked in the Sort dialogue box, depending on your data?
  • Levels: Are all necessary sort levels (primary and any secondary levels) correctly defined in the Sort dialogue box?
  • Order: Is the sort order (A to Z, Z to A, Smallest to Largest, Oldest to Newest, etc.) correct for each chosen level?
  • Review: Did you take a moment to visually review the sorted data immediately after applying the sort, checking for any unexpected changes or scrambling?
  • Save: Did you save your changes once you confirmed the sort was successful?