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. When you're finished, all the names are associated with the wrong phone number.
Here are some tips for trouble free sorting:
1. 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.
2. Save the file before you sort the list. Then, if the list get scrambled, you can close the list without saving it again.
3. 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.
- 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.
- 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
- From the Then By drop down, select the second column that you want to sort – Order Date in this example.
- Add other levels, if necessary.
- Click OK