Sorting Data

The Excel sort function is useful for rearranging data. When working in Excel sorting data can quickly reorganize content too.

Custom sorting

Sometimes you may find that the default sorting options can't sort data in the order you need. Fortunately, Excel allows you to create a custom list to define your own sorting order.

To create a custom sort:

In our example below, we want to sort the worksheet by T-Shirt Size (column D). A regular sort would organize the sizes alphabetically, which would be incorrect. Instead, we'll create a custom list to sort from smallest to largest.

  1. Select a cell in the column you want to sort by. In our example, we'll select cell D2.
    Selecting cells
  2. Select the Data tab, then click the Sort command.
    The Sort button on the Data tab
  3. The Sort dialog box will appear. Select the column you want to sort by, then choose Custom List... from the Order field. In our example, we will choose to sort by T-Shirt Size.
    The Sort dialog box
  4. The Custom Lists dialog box will appear. Select NEW LIST from the Custom Lists: box.
  5. Type the items in the desired custom order in the List entries: box. In our example, we want to sort our data by T-shirt size from smallest to largest, so we'll type Small, Medium, Large, and X-Large, pressing Enter on the keyboard after each item.
    The Custom Lists dialog box
  6. Click Add to save the new sort order. The new list will be added to the Custom lists: box. Make sure the new list is selected, then click OK.
    Clicking OK
  7. The Custom Lists dialog box will close. Click OK in the Sort dialog box to perform the custom sort.
    Clicking OK
  8. The worksheet will be sorted by the custom order. In our example, the worksheet is now organized by T-shirt size from smallest to largest.
    The sheet has now been sorted with our custom criteria.

Sorting levels

If you need more control over how your data is sorted, you can add multiple levels to any sort. This allows you to sort your data by more than one column.

To add a level:

In our example below, we'll sort the worksheet by T-Shirt Size (Column D), and then by Homeroom Number (column A).

  1. Select a cell in the column you want to sort by. In our example, we'll select cell A2.
    Select cells
  2. Click the Data tab, then select the Sort command.
    The Sort button on the Data tab
  3. The Sort dialog box will appear. Select the first column you want to sort by. In this example, we will sort by T-Shirt Size (column D) with the custom list we previously created for the Order field.
  4. Click Add Level to add another column to sort by.
    The Sort dialog box
  5. Select the next column you want to sort by, then click OK. In our example, we'll sort by Homeroom # (column A).
    The Sort dialog box
  6. The worksheet will be sorted according to the selected order. In our example, the orders are sorted by T-shirt size. Within each group of T-shirt sizes, students are sorted by homeroom number.
    The multi-level sort is applied to the worksheet

If you need to change the order of a multilevel sort, it's easy to control which column is sorted first. Simply select the desired column, then click the Move Up or Move Down arrow to adjust its priority.

Move levels up or down