Safely Sorting Data in Excel

It seems simple enough, but sorting data in Excel can go horribly wrong, if you aren’t careful.

For example, you could sort a list of names, but miss the phone numbers in a nearby column. Then, when you’re finished sorting, all the names are associated with the wrong phone number.

Trouble Free Excel Sorting

Here are some tips for trouble free sorting in Excel:

  • Make a backup copy of your file before you sort the list. If there are problems with the sorted list, you can use a copy of your backup file instead.
  • Save the file before you sort the list. Then, if the list get scrambled, you can close the list without saving it again.
  • Before you sort, select all the cells in the list. This is the safest approach to sorting. In most cases, you can select one cell and Excel will correctly detect the rest of the list — but not always. If there are blank rows or columns, some of the data may not be included in the sort, and the list will be scrambled.

Sort Excel Data by One Column

In some lists, you might want to sort by one column. For example, in a list of sales orders, you could sort by Order Number.

  • Select all the cells in the list. Tip: Use the keyboard shortcut Ctrl + A.
  • On the Ribbon, click the Data tab, then click Sort.

DataSortCommand

  • From the Sort by dropdown, select the column you want to sort.
    Note: If the dropdown is showing Column letters instead of headings, add a check mark to My data has headers.

SortHeaders

  • From the Sort On drop down, select Values.
  • From the Order drop down, select A to Z, or Z to A.
  • Click OK

Sort Excel Data by Two or More Columns

Sometimes you need to sort by multiple columns.

For example, in a list of sales orders, you could sort by Customer Name and then by Order Date.

The customers would be sorted alphabetically, and if there are multiple orders for a customer, those orders would be sorted by date.

  • Follow steps 1 to 5 in the Sort Excel Data by One Column instructions above, to sort by Customer Name.
  • Click Add Level

SortAddLevel

  • From the Then By drop down, select the second column that you want to sort – Order Date in this example.

SortTwoLevels

  • Add other levels, if necessary.
  • Click OK

_______________________

0 thoughts on “Safely Sorting Data in Excel”

  1. I agree with Jon Peltier

    The sorting is very reliable if you have column headers.

    To trust Excel 2003 Sorting just follow the Microsoft recommendations to work with lists (data regions):

    1. Use only one list per worksheet
    2. Put similar items in one column
    3. Keep the list separate
    4. Position critical data above or below the list
    5. Show rows and columns

    Enhance your Sorting efficiency with new Excel.

    Excel 2007 Table treat data region as a whole, you filter and sort more consistently

    Excel table manage blanks consistently too.

  2. I used to add a numeric column to the far right of whatever I was sorting, just in case I needed an easy way to get it back in the original order.

    THese days most of my data comes from SQL Server presorted, and has keys associated with it.

  3. I have an index list that is a little over 8000 lines and 4 columns. When I add to the list and then sort, it scrambles some of the data. Last time it was just the D’s. What could be causing this?

  4. I always put headers on top of my columns, and am careful about how I sort, but apparently not careful enough. I’ve discovered that the right-hand third of my “source data” columns are scrambled. SHIT. This really sucks, and I think the Excel team could have done a better job of this. going forward I will convert my solution to store source data in Access, instead. I may go directly from Excel to Access, or I may just convert my existing Excel “source data” sheet to pull from Access. This is what I get for using Excel as a database–BAD.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.