How to Sort in Excel – 6 Examples

Download Practice Workbook

Download the free Excel worksheet.

Example 1 – Sort in Ascending Order

  • To sort the dataset in Ascending order according to the Writer Names, select any cell in the Writer column and go to Data Tab > Sort & Filter Group > Sort A to Z.
  • The dataset is sorted.
Note: You can also access  Sort & Filter by going to Home Tab > Editing > Sort & Filter or by Right-clicking and going to Sort.

Sort in ascending order


Example 2 – Sorting in Descending Order in Excel

  • To sort the dataset in descending order according to Quantity Sold, select any cell in the Quantity Sold column and go to Data Tab > Sort & Filter > Sort Z to A.
  • The dataset is sorted.

Sort in descending order


Example 3 – Custom Sorting

The Characteristics column was added to the dataset.

The books that sold more than 25 copies are Best Sellers, the books that sold more than 15 but less than 25 copies are classified as Midlist, and the books that sold less than 15 copies are classified as Backlist.

  • Sort the books according to their Characteristics.

Characteristic column for custom sort

  • Go to File > Options > Advanced.
  • Choose Edit Custom Lists.

Select Edit Custom List for custom sorting

  • In Custom Lists, click Import List.
  • The list will be shown in the List Entries.
  • Click OK to add the list to the custom list options.

Import custom list

  • Select any cell in the Characteristics column and go to Data Tab > Sort & Filter Group > Sort.

Select Sort from Sort & Filter

  • Select Characteristics as Column.
  • Select Custom List in Order.

Select Custom list to filter with custom list

  • Select the custom list and click OK.

Select custom list to sort with

  • Click OK in the sort window.

Click on OK to sort with custom list

The dataset is sorted.

Custom sorted dataset


Example 4 – Sorting with Multiple Levels

  • Go to Data Tab > Sort & Filter Group > Sort.

Select sort from the Sort & Filter group

  • Select Writer as Column and the order as A to Z.

select column and order

  • Click Add Level and select Book as Column and the order as A to Z.
  • Click OK to sort the dataset.

Sort with multiple levels

The dataset is sorted.

Sorted data according to multiple levels

Note: You can use this method to sort with multiple rows or columns in Excel.

Example 5 – Using a Filter to Sort Data

  • Select any cell in the dataset and go to Data Tab > Sort & Filter > Filter.

The headers will display a down arrow.

turn on Filter from Sort & Filter

  • Select the down arrow of the column you want to sort. Here, Sort Z to A in the Book column.

The dataset is sorted.

Using filter to sort data


Example 6 – Sort by Color

The best-sellers are colored green and the backlist books are colored yellow.

  • Select any cell in the books column and go to Data Tab > Sort & Filter Group > Sort.
  • Select Book as Column and Cell Color in Sort On.
  • Select Green in Order.
  • In the dropdown list, select On Top to show green colored books on top.

select appropriate inputs to sort by color

  • Copy this level by clicking Copy Level.
  • For Yellow, select On Bottom.
  • Click OK to sort the dataset.

copy level and select appropriate inputs

The dataset is sorted,

Sorted dataset according to color


Things to Remember

  • Make sure there are no blank cells in the column that you want to sort.
  • If the column headers are in the same format as the dataset, they will be sorted. Select data without headers.
  • Merged cells in the dataset may lead to unexpected results.

Frequently Asked Questions

If I have duplicate entries in my dataset, how will Excel sort them?

A: Excel does not sort duplicates in any particular order. The data that occurs first will be shown first.


How to Sort in Excel: Knowledge Hub


Conclusion

We hope you find this article useful in solving your problems regarding sorting in Excel. Sorting is frequently used in Excel to make the dataset visually appealing. Go over the methods described here to get a better understanding of how to sort in Excel.


<< Go Back to Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Maruf Niaz
Maruf Niaz

Md. Maruf Niaz, BSc, Textile Engineering, Bangladesh University of Textiles, has worked with the ExcelDemy project for 11 months. He works as an Excel and VBA Content Developer who provides easy solutions to Excel-related problems and regularly writes fantastic content articles. He has published almost 20 articles in ExcelDemy. As an Excel & VBA Content Developer for ExcelDemy, he offers solutions to complex issues. He demonstrates an enthusiastic mindset and adeptness in managing critical situations with finesse, showcasing... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo