Sort Data in Excel

Publication Date :

Blog Author :

Download FREE Sort Data Excel Template and Follow Along!
Sort DataExcel Template.xlsx

Table Of Contents

arrow

What is Sort in Excel?

SORT in Excel means arranging the data in a determined order. For example, sometimes we need to place the names alphabetically, sort the numbers from smallest to largest, largest to smallest, dates from oldest to latest, latest to oldest, etc. In Excel, we have a built-in tool called the "SORT" option. This "Sort" option can help us sort the data based on the condition we provide.

The "SORT" option in Excel is under the "Data" tab.

sort option - step 1

  • The "SORT" option plays a key role in organizing the data. For example, if the monthly sales data is not in order from Jan to Dec, it may not be a proper organizing way of the data structure.
  • Excel "SORT" option will help us solve all kinds of data to make life easy. In this article, we will demonstrate the usages of the "SORT" option in Excel and save a lot of time.

How to Sort Data in Excel?

Example #1 - Single Level Data Sorting

It will sort the data based on only one column, nothing else.

Now, look at the below data. Again, we have sales of different products by segment and country.

sort option in excel - Example 1

We have the data until the 700th row. Download the Excel file to follow along here.

We want to sort them based on the "Country" column from A to Z.

Below are the steps used for single-level data sorting:

  1. First, select the data that we want to sort. Next, you can use the shortcut key to select the entire data, select the first row, and then click "Ctrl + Shift + Down Arrow."


    sort option in excel - Example 1-1

  2. Go to the "Data" tab > "Sort." The shortcut key to open the "Sort" option is "ALT + D + S."


    sort option in excel - Example 1-2

  3. Make sure the “My data has headers” checkbox has been ticked. If this box has ticked means, the selected data has headers. Otherwise, your header will be treated as the data only.


    sort option in excel - Example 1-2

  4. Click on the "Sort by" dropdown list and select the word "Country."


    sort option in excel - Example 1-3

  5. Click on "Sort On." Here, we can sort based on values, cell color, font color, and conditional formatting icon.


    Click on Sort On

  6. Finally, select the "Order." You can sort A to Z, Z to A, and a custom list here.


    select the Order

  7. The final "SORT" dialog box should look like this.


    Final SORT of dialogue box

  8. Click on "OK." It will sort the data country-wise alphabetically from A to Z.


    sort option in excel - Example 1-7

Example #2 - Multi-Level Data Sorting

In the previous example, we have learned single-level sorting. In this example, we will explain the multi-level sorting process.

Previously, we sorted the data country-wise. Assume we want to sort the data segment-wise, product-wise, and units sold from largest to smallest. It requires multi-level sorting.

  • Step 1: Select the data. (We are using the same data from the previous example)
sort option in excel - Example 1-1
  • Step 2: Press "ALT + D + S." (shortcut key to open the SORT box)
Press ALT + D + S
  • Step 3: First, select the "Segment" heading.
select Segment heading
  • Step 4: Click "Add Level" to insert one more layer.
click on Add Level
  • Step 5: From the second layer, select the "Product."
second layer select Product
  • Step 6: Click "Add Level" to add the third layer.
click on Add Level
  • Step 7: Select the "Units Sold" header from the third layer.
select Units Sold header
  • Step 8: The "Order" will default to "Smallest to Largest." Under "Order," click on the dropdown list and select "Largest to Smallest."
click on the dropdown list
  • Step 9: It will sort the layers alphabetically. It will sort the "Units Sold" column from the largest to the lowest value.
sort option in excel - Example 2-6

Firstly, it will sort the data based on the "Segment" column. Next, they will sort by "Product" and finally by "Units Sold" (largest to smallest).

Example #3 - Sorting Dates Data

We have a sales table country-wise on different dates. So, we want to sort the data country-wise first and then date-wise (oldest to newest).

  • Step 1: Select the data first.
sort option in excel - Example 2-7
  • Step 2: Open the "Sort" option. (ALT + D + S)
Open sort of option
  • Step 3: Select a "Country" header in the first drop-down list.
drop-down list select Country-wise header
  • Step 4: Click "Add Level" to insert one more layer.
Click on Add Level
  • Step 5: Select the "Date" header from the second layer.
sort
  • Step 6: By default, orders selected "Oldest to Newest." Our objective is to sort from oldest to newest.

Click on "OK" to sort.

sort option in excel - Example 3-4

Things to Remember

  • We need to select the entire to sort. Otherwise, left-out columns will be as it is.
  • Ensure the "My data has headers" check has been selected to sort the data.
  • We can sort the colored cells, colored font, etc.
  • We also sort the data by applying the filter in excel.
  • We can sort from A to Z and Z to A in the case of the alphabet.
  • We can sort from "Largest to Smallest" and "Smallest to Largest" in the case of numbers.
  • In the case of dates, we can sort from "Oldest to Newest" and "Newest to Oldest."