How can I sort by multiple columns in Excel?

To sort by multiple columns in Excel, first select the entire data range. Then, go to the “Data” tab and click on “Sort.” In the Sort dialog box, choose the first column to sort by and select the desired sorting order. Next, click on “Add Level” to add another column to sort by. Repeat this process for all the columns you want to sort by. Finally, click on “OK” to apply the sorting criteria and the data will be sorted according to the selected columns. This feature is useful for organizing and analyzing data with multiple categories or variables.

Sort by Multiple Columns in Excel


Often you may want to sort by multiple columns in Excel. Fortunately this is easy to do using the Custom Sort option.

This tutorial provides a step-by-step example of how to use custom sort in practice.

Step 1: Create the Data

First, let’s create a fake dataset to work with:

Step 2: Sort by Multiple Columns

Next, we will sort the data in the following manner:

  • First, sort by Household Size from largest to smallest.
  • Next, sort by Last Name from A to Z.

To do this, highlight each of the columns including the headers:

Next, click the Sort & Filter option within the Editing section of the Home tab. In the dropdown menu, click Custom Sort.

In the window that appears, sort by Household Size and choose Largest to Smallest.

Then, click Add Level in the top left corner and sort by Last Name and choose A to Z.

Sort by multiple columns in Excel

Once you click OK, the data will automatically be sorted:

Multiple column sort in Excel

Notice that the rows are sorted by Household Size from largest to smallest, which is why the household with a size 7 appears first.

Next, we sort by Last Name from A to Z. This means for any households that have the same size, we determine their order by sorting from A to Z.

For example, each of the households that have a size of 4 are sorted from A to Z:

Note that in this example we sorted by two columns, but using the Custom Sort option you can sort by as many columns as you’d like.

x