Learn the secrets of Sorting Data with Excel

Sort your data

To make your data easier to read, Excel has a very effective sorting tool in the Data tab.

Sort Menu

Consider the following table:

Fruits Sales

We want to sort this table by Country in ascending order.

  1. Select one of the cells in the column you want to sort (not necessarily the header)
  2. Click the A-Z icon to sort in ascending order
Sort data increasing order

Now we want to sort the Total column in descending order.

  1. Select one of the cells in the Total column
  2. Select the Data tab
  3. Click the Z-A icon
Sort the Total in Decreasing order

Sort across multiple columns

In Excel, you can sort on as many columns as you want, up to a limit of 256. For example, we want to sort the following table by Product and Date.

Sort on multi columns

To sort on two or more columns, open the sorting options dialog box from the ribbon.

Open the sort option

To sort on several columns, proceed as follows:

  1. Check that the Header option is checked
  2. Specify the first sort column: Fruit
  3. Click the Add Level button
  4. Specify the second sort key: Date
Sort on Multi columns

Sort on colors

In Excel, it's common to highlight cells with colors that matter to you. Using the sorting tool, you can then sort columns by color.

Sort on colors
  1. From the sort dialog box, you can specify that you want to sort on a color
Sort select the option cell colors
  1. Then you'll choose one color. The dialog box shows you all the colors used in the column.
Select the color to do the sort
  1. Add a new Level
  2. Repeat the same steps for another color
Select the second color to sort

The result is as follows. Note that only colors are sorted and not column values.

To sort on two colors in the same column, you need to create a sort key on that same column.

Sort on two different colors

This gives the following result:

Result of the sort on the colors

Spot the sort option

Look at the result below. As we saw above, sorting by color only reorders the colors themselves — it doesn't touch the other column values. Can you tell which sort option produced this result?

Question sort options on color

Sort with column header arrows

There is another way to sort your data: using the options in Filter (next section).

To add the sort or filter arrows to your column headers, you can either:

  • Use the key combination Ctrl + Shift + L
  • Click the Data icon > Filter
Icon to add arrows in the headers

This adds arrows to each column header.

Filter and Sort options

Click the arrow on one of the headers to find the same sorting options we saw earlier (ascending order, descending order, and sorting by color).

Sort option from the headers

CAUTION: sorting on several columns from the arrows is impossible. Only one column can be sorted.

Wrap-up

You now have the full sorting toolkit in Excel: quick ascending/descending sorts, multi-column sorting with the dialog box, sorting by color, and the fast (but single-column) header arrows.

Continue learning

Keep building your Excel skills with the rest of this tutorial series: