How to Sort and Filter Data in Excel – A Complete Guideline

 

What is Sort and Filter in Excel?

Sort and filter options in Excel narrow down a dataset allowing a deeper analysis.

Using the filter tool, you can filter a column based on given criteria. The sorting tool allows you to sort data based on alphabetical order, numbers, dates, etc.

This is a sample dataset:

After sorting data based on Profit, in descending order:

Sort and Filter in Excel

Filter the dataset based on “South”:

Sort and Filter in Excel


How to Enable Sort And Filter in Excel

  • Click any cell in the dataset.
  • Go to the Data tab.
  • In Sort & Filter, click Filter.

You will see the dropdown beside every column header.

Sort and Filter in Excel

 


Types of Sort in Excel

 

1. Sort in Alphabetical Order

Sort data in alphabetical order. Choose A to Z or Z to A.

Steps

  • Click the dropdown menu beside “Name”.

  • Click Sort A to Z to sort the Name column in ascending order.

Sort in Alphabetical Order

  • If you click Sort Z to A, data will be sorted in descending order.

Sort in Alphabetical Order

Read More: How to Perform Random Sort in Excel


2. Sort by Smallest to Largest in Excel

If you have numerical data, sort it from smallest to largest.

Steps

  • Click the dropdown menu beside the Total Sales column.

Sort by Smallest to Largest in Excel

  • Click Sort Smallest to Largest.

Sort by Smallest to Largest in Excel


3. Sort by Largest to Smallest

Sort data in the Profit column.

Steps

  • Click the dropdown menu beside the Profit column.

  • Click Sort Largest to Smallest.

Sort by Largest to Smallest

Read More: How to Sort Excel Tabs


4. Multi-level Sort in Excel

You can also call it “Custom Sort” Multi-level sorting means sorting based on multiple columns.

  • Sort data based on Region (A to Z).
  • Sort it again based on Total Sales (Largest to Smallest).

Steps

  • Click the dropdown menu beside “Region”.

Multi-level Sort in Excel

  • Select Sort by Color.
  • Click Custom Sort.

  • Select Region in Sort by.
  • Select Cell values and A to Z.

  • Click Add Level.

Multi-level Sort in Excel

  • Select Total Sales in Then by.
  • Select Cell values and Largest to Smallest.
  • Click OK.

Multi-level Sort in Excel

 


5. SORT Function

Use the SORT function.

To sort data based on the Product column (Descending order):

Steps

  • Enter the following formula in H5:

=SORT(B5:F15,3,-1)

SORT Function

  • Press Enter.

SORT Function

Read More: Advantages of Sorting Data in Excel


Types of Filter in Excel

 

1. Regular Filter

A regular filter means you can filter data based on any values.

Filter the dataset based on “TV”:

Steps

  • Click the dropdown menu beside Product.

Filter in Excel

  • Uncheck Select All.

  • Check“TV” and click OK.

Filter in Excel

 


2. Text Filters / Number Filters in Excel

Filter text with Text Filters. Excel automatically shows Number Filters in columns containing numeric values.

Filter the dataset based on the Total Sales less than $3500.

Steps

  • Click the dropdown menu beside Total Sales.

Filter in Excel

  • Select Number Filters and click Less Than.

Filter in Excel

  • Enter $3500.
  • Click OK.

Filter in Excel

Read More: How to Perform Custom Sort in Excel


3. Custom Filter

You can use the Custom Filter with the AND or the OR logic.

To filter data based on the Total Sales greater than $2000 but less than $3000:

Steps

  • Click the dropdown menu beside Total Sales.

  • Select Number Filters and click Custom Filter.

  • Enter the values.
  • Select And and click OK.

Filter in Excel

Read More: Advanced Sorting in Excel


How to Undo Sort and Filter in Excel

1. Undo Sort:

  • Click Undo or press Ctrl+Z.

Or:

  • Create a temporary column.

2. Undo Filter

  • Click the dropdown menu to which you applied filtering.

  • Click Clear Filter From “Region” (column name can be different based on your filtering).

Filter in Excel

To remove the dropdown menu:

  • Click any cell in your dataset.
  • Go to the Data tab.

Filter in Excel

  • In Sort & Filter, click Clear.

Read More: Difference Between Sort and Filter in Excel


 

Download Practice Workbook

Download the practice workbook.


 

Related Articles


<< Go Back to Sort in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
A.N.M. Mohaimen Shanto
A.N.M. Mohaimen Shanto

A.N.M. Mohaimen Shanto, a B.Sc. in Computer Science and Engineering from Daffodil International University, boasts two years of experience as a Project Manager at Exceldemy. He authored 90+ articles and led teams as a Team Leader, meticulously reviewing over a thousand articles. Currently, he focuses on enhancing article quality. His passion lies in Excel VBA, Data Science, and SEO, where he enjoys simplifying complex ideas to facilitate learning and growth. His journey mirrors Exceldemy's dedication to excellence and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo