Start Free Trial
← Back to Blog

How to Sort Data in Excel: A Comprehensive Guide

Sorting data in Excel is a fundamental skill that allows users to organize information in meaningful ways. Whether you're working with large datasets, analyzing sales reports, or managing inventory, sorting can make your data more readable and useful.

In this blog post, we’ll cover the various ways to sort data in Excel, from simple sorts to more advanced multi-level sorting, and why sorting is an essential feature for data analysis.

Basic Sorting in Excel

Excel allows you to quickly sort data based on the values in one column. Here’s how to do it:

Step 1: Select the Data Range

Step 2: Open the Sort Option

Step 3: Verify the Range

Sorting by One Column

Let’s say you have a list of sales figures, and you want to sort them from highest to lowest. Here’s how to do that:

  1. Select the Column to Sort By:
  1. Sort A to Z or Z to A:

Example:

If you have a column of sales data in Column B, you would click anywhere in Column B and then select Sort Largest to Smallest to see the highest sales figures at the top.

Sorting by Multiple Columns (Multi-Level Sorting)

Sometimes, sorting by one column isn’t enough. If you have duplicate values in one column, you may want to sort by a second or third column to organize the data further.

Step 1: Open the Sort Dialog Box

Step 2: Add Sorting Levels

Example:

Imagine you have a list of employees with columns for Department, Last Name, and Salary. You want to first sort by Department, then by Last Name, and finally by Salary in descending order. Here’s how to do it:

  1. In the Sort by field, select Department.
  2. Click Add Level and select Last Name.
  3. Click Add Level again and choose Salary, and then select Largest to Smallest.

This will organize the employees first by department, then alphabetically by last name within each department, and finally by salary within each group.

Sorting by Custom Lists

Excel also allows you to sort data using custom lists. This is especially useful when sorting months, weekdays, or other non-alphabetical data.

Step 1: Open the Sort Dialog Box

Step 2: Choose Custom List

Step 3: Select a Predefined List or Create a Custom List

Example:

If you're sorting by a column that contains months (e.g., January, February), Excel will automatically recognize the sequence and sort accordingly. This saves you from having to manually define the order.

Sorting Data with Formulas or Errors

When sorting columns that contain formulas or errors (such as #DIV/0! or #N/A), Excel follows specific rules:

To avoid complications with sorting when formulas or errors are involved, consider filtering out error values first before sorting the rest of the data.

Sort by Cell or Font Color

Excel allows you to sort based on formatting such as cell color, font color, or icon sets.

Step 1: Open the Sort Dialog Box

Step 2: Choose to Sort by Color

Example:

If you’ve highlighted certain cells in a “Priority” column using a red fill for high priority, yellow for medium, and green for low, you can sort by color to bring high-priority items to the top.

Using Sort in PivotTables

Sorting within PivotTables is slightly different from sorting in regular Excel tables. Here’s how you can do it:

  1. Click on the Column or Row Label: In the PivotTable, click on the column or row label you want to sort.
  2. Right-Click to Access Sorting Options: Right-click and choose Sort from the context menu.
  3. Sort Ascending or Descending: Choose either Sort A to Z or Sort Z to A to reorder the PivotTable.

PivotTable sorting can be applied not only to labels but also to values within the table.

Common Excel Sorting Mistakes to Avoid

  1. Not Selecting the Entire Data Range: If you only select a column instead of the whole table, Excel will prompt you with an option to expand the selection. Always sort the entire dataset to avoid misaligning your data.
  2. Not Checking "My Data Has Headers": If your dataset includes headers, make sure to check the "My data has headers" box in the sort dialog. If unchecked, Excel might include the headers in the sort, leading to confusion.
  3. Sorting Without Saving: Always save your data before performing a sort, especially when working with large datasets. Mistakes in sorting can lead to data misalignment, making it difficult to revert back.

Why Sorting is Essential in Excel

Sorting in Excel isn’t just about arranging your data neatly. It plays a key role in:

Sorting data in Excel is a crucial skill for organizing and analyzing information efficiently. Whether you’re performing simple sorts or working with multi-level sorts across complex datasets, Excel provides a variety of tools to help you stay organized. By mastering the sorting features, you can enhance your data analysis capabilities and improve your productivity in Excel.

📁 Get All Templates Free →

Opens in Google Drive — view and download for free

Ready to try Updoot free?

GPS time tracking, scheduling, HR, payroll, CRM, and more in one platform built for small business.

Start Free Today