Sort Data in Excel

What is Sort in Excel?

SORT in excel means arranging the data in a determined order. Sometimes we need to arrange 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 an inbuilt tool called SORT option. This sort option can help us to sort the data based on the condition we give.

In excel SORT option is located under the Data tab.

sort option - step 1
  • In order to organize the data, the SORT option plays a key role in it. 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 to solve all kinds of data to make life easy. In this article, I will demonstrate the usages of the SORT option in excel and save a lot of time.

How to Sort Data in Excel?

You can download this Sort Options Excel Template here – Sort Options Excel Template

Example #1 – Single Level Data Sorting

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

Now, look at the below data. I have sales of different products by Segment and Country.

sort option in excel - Example 1

I have the data until the 700th row. Download the excel file to follow along with me.

Now I want to sort them based on the Country column from A to Z.

Below are the steps used for single level data sorting –

  1. Select the data that we want to sort. 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 Data tab > Sort. The shortcut key to open the sort option is ALT + D + S.


    sort option in excel - Example 1-2

  3. Now make sure the “My data has headers” checkbox has ticked. If this box has ticked means, the selected data has headers otherwise;, your will header will be treated as the data only.


    sort option in excel - Example 1-2

  4. Click on Sort by drop-down 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 Colour, Font Colour, and Cell Icon.


    Click on Sort On

  6. Finally, select the Order. Here you can sort A to Z, Z to A, and custom list.


    select the Order

  7. Final SORT of dialogue box should look like this.


    Final SORT of dialogue box

  8. Click on OK it will sort the data country-wise alphabetically 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, I will explain to you the process of Multi-level sorting.

Previously I sorted the data country-wise. Assume I want to sort the data Segment-wise, Product-wise, and Units sold from largest to smallest. This requires multi-level sorting.

  • Step 1: Select the data. (I am 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 Segment heading.
select Segment heading
  • Step 4: Now, click on 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: Now, click on Add Level to add the third layer.
click on Add Level
  • Step 7: From the third layer, select the Units Sold header.
select Units Sold header
  • Step 8: by default, the Order will be from Smallest to Largest. Under Order, click on the dropdown list and select Largest to Smallest.
click on the dropdown list
  • Step 9: Both the layers will be sorted alphabetically, and Units Sold will be sorted from the largest value to the lowest value.
sort option in excel - Example 2-6

Firstly, it will sort the data based on the Segment column. They will sort by Product and finally by Units sold (largest to smallest).

Example #3 – Sorting Dates Data

I have a sales table country-wise at different dates. I 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 sort of option. (ALT + D + S)
Open sort of option
  • Step 3: In the first drop-down list, select a Country-wise header.
drop-down list select Country-wise header
  • Step 4: Click on Add Level to insert one more layer.
Click on Add Level
  • Step 5: From the second layer, select the Date header.
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.
  • Make sure my data has a header check that has been selected to sort the data.
  • We can sort the colored cells, colored font, etc.…
  • We sort the data by applying the filter in excel as well.
  • We can sort from A to Z, Z to A in case of alphabetic.
  • We can sort from Largest to Smallest, Smallest to Largest in case of numbers.
  • In the case of dates, we can sort from Oldest to Newest, Newest to oldest.

Recommended Articles

This has been a guide to Sort in Excel. Here we will demonstrate the SORT option in excel (Single Level and Multi-Level Sorting) along with an excel example and a downloadable template. You may also look at these useful functions in excel –

  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion
LEARN MORE >>
Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *