Sort Excel Column Based on Another: Step-by-Step

Sorting data in Excel can be a breeze once you understand the basics. Today, we're going to focus on sorting one column based on another. This can be particular...

Sorting data in Excel can be a breeze once you understand the basics. Today, we're going to focus on sorting one column based on another. This can be particularly useful when you have a large dataset and you want to organize it in a specific way. Let's dive right in!

How to Use Columns Formula in Excel
How to Use Columns Formula in Excel

Before we start, ensure your Excel version is up-to-date. The steps might vary slightly depending on the version you're using. We'll be using Excel 365 for this guide.

How To Move Multiple Rows and Columns In Excel - The Easy Way!
How To Move Multiple Rows and Columns In Excel - The Easy Way!

Understanding the Sorting Process

Sorting in Excel involves arranging data in ascending or descending order based on the values in a specific column. In our case, we'll be sorting one column based on the values in another. Imagine you have a list of customers with their names and ages. You want to sort the list by age, but you also want the names to follow their respective ages. That's what we'll achieve today.

Grouping Rows/Columns in Excel📚
Grouping Rows/Columns in Excel📚

To illustrate, let's assume you have the following data:

NameAge
John30
Jane25
Mike35
Emily28
How to merge and combine Excel spreadsheets into one
How to merge and combine Excel spreadsheets into one

Sorting by a Single Column

Before we sort one column based on another, let's first understand how to sort by a single column. Select the data you want to sort, then click on the 'Sort & Filter' button in the 'Home' tab. Choose 'Sort A to Z' or 'Sort Z to A' depending on whether you want ascending or descending order.

For our example, if we sort the 'Age' column in ascending order, we get:

Resize Rows and Columns
Resize Rows and Columns
NameAge
Jane25
Emily28
John30
Mike35

Sorting by a Single Column and Then Another

Now, let's sort the 'Name' column based on the 'Age' column. Select the 'Name' column, then click on the 'Sort & Filter' button. This time, choose 'Sort by Another Column'. In the dialog box that appears, select 'Age' as the column to sort by, and choose the sort order. Click 'OK'.

How to Add a Column in Excel Without Moving Data the Wrong Way
How to Add a Column in Excel Without Moving Data the Wrong Way

Voila! Your data is now sorted by age, with the names following their respective ages:

NameAge
Jane25
Emily28
John30
Mike35
How to Transpose data from rows to columns in excel
How to Transpose data from rows to columns in excel
Excel Sort by Column or Row One or Multiple Sort by Cell Color Font Color Customize Sort
Excel Sort by Column or Row One or Multiple Sort by Cell Color Font Color Customize Sort
an excel spreadsheet showing the number and type of columns in each column,
an excel spreadsheet showing the number and type of columns in each column,
Sum a Column Based on Values in Another - Excel University
Sum a Column Based on Values in Another - Excel University
How to Rearrange Columns in excel quickly - Tamil
How to Rearrange Columns in excel quickly - Tamil
How to Split Text Data of a Cell to Column in Excel - ExcelDataPro
How to Split Text Data of a Cell to Column in Excel - ExcelDataPro
Auto adjust column using view code in Excel #excelshorts #ytshorts #shorts
Auto adjust column using view code in Excel #excelshorts #ytshorts #shorts
Microsoft Excel Tutorials: Rows and Columns
Microsoft Excel Tutorials: Rows and Columns
Excel 2016 - Add Rows and Columns - How to Insert a Row & Column in MS 365 - Multiple Cells on Table
Excel 2016 - Add Rows and Columns - How to Insert a Row & Column in MS 365 - Multiple Cells on Table
Autofit Rows and Columns in Excel with VBA
Autofit Rows and Columns in Excel with VBA
Excel Pro Tricks: Dynamically Extract Data Columns based on String in Excel with CHOOSECOLS Function
Excel Pro Tricks: Dynamically Extract Data Columns based on String in Excel with CHOOSECOLS Function
Apply a Formula to an Entire Column in Excel
Apply a Formula to an Entire Column in Excel
Post from Short and Clear Excel
Post from Short and Clear Excel
How to merge multiple columns into a single column using Microsoft Excel
How to merge multiple columns into a single column using Microsoft Excel
Your Excel Tables Will Never Look the Same After This
Your Excel Tables Will Never Look the Same After This
How to Filter Column Based on Another Column in Excel (5 Methods) - ExcelDemy
How to Filter Column Based on Another Column in Excel (5 Methods) - ExcelDemy
How To Combine Two Columns In Excel
How To Combine Two Columns In Excel
an excel spreadsheet is shown in this screenshot
an excel spreadsheet is shown in this screenshot
ExcelTips
ExcelTips
How to Combine Two Columns in Microsoft Excel
How to Combine Two Columns in Microsoft Excel

Sorting with Multiple Levels

What if you want to sort by more than one column? Let's say you want to sort by age first, and then by name. Here's how:

First, sort by the primary column (in our case, 'Age') using the steps above. Then, select the sorted data, click on 'Sort & Filter', and choose 'Sort by Another Column'. This time, select the secondary column (in our case, 'Name') and choose the sort order. Click 'OK'.

Your data will now be sorted by age, and then by name within each age group:

NameAge
Jane25
Emily28
John30
Mike35

And there you have it! You've now mastered the art of sorting one column based on another in Excel. Happy sorting!