In Excel, this is referred to as a “custom sort.”

Let’s take a look.

Here we have a table that contains monthly sales data for a list of customers.

For example, we could sort by the date of the first order, or by the state.

For that, we need to use custom sort.

Excel will then initiate the Sort dialog box.

The Sort dialog allows you to sort one or more columns, referred to as “levels.”

Note that Excel will take a stab at guess if a table contains headers or not.

it’s possible for you to control this behavior by checking and unchecking this box.

To sort by State, then City, Choose State for the column.

For Sort On, the default of “value” is fine.

Leave the Order at the default value of A to Z.

Now add a new level for City.

The only thing we need to change is the column.

When you press OK, the table is sorted first by State, then by City.

Now let’s sort the table by State, then by Orders in descending value.

Again, we choose custom sort.

Now the table is sorted first by State, and second by Orders.