Excel Formula to Alphabetize by Last Name

Sorting a list of names in alphabetical order, especially by last name, can be a breeze with Excel's built-in sorting feature. However, if you're looking for a ...

Sorting a list of names in alphabetical order, especially by last name, can be a breeze with Excel's built-in sorting feature. However, if you're looking for a more dynamic approach using formulas, Excel offers several options. In this guide, we'll explore the Excel formula to alphabetize by last name, ensuring your data remains organized and easy to navigate.

How to Alphabetize by last name in Excel
How to Alphabetize by last name in Excel

Before we dive into the formulas, let's assume we have a dataset like this:

How to split full name to first and last name in Excel?
How to split full name to first and last name in Excel?
First NameLast Name
JohnDoe
JaneSmith
MikeJohnson

Using the SORT Function

How to Sort Names Alphabetically in Excel
How to Sort Names Alphabetically in Excel

The SORT function in Excel is a powerful tool for arranging data in ascending or descending order. It's particularly useful when you need to sort by multiple columns or have complex sorting criteria.

To sort the above dataset by last name in ascending order, use the following formula:

Extract Last Name using TEXTAFTER function in Excel
Extract Last Name using TEXTAFTER function in Excel

Sorting by Last Name (Ascending)

Assuming your data starts from A1 (First Name) and B1 (Last Name), enter this formula in cell C1 and drag it down:

=SORT(B1:B5, 1)

989K views · 11K reactions | 🏃‍♂️🔣💡 Excel's Flash Fill feature can quickly separate First Name, Middle Name, and Last Name from a full name, or even First Name, Initial, and Last Name, saving you time a | Excel Formulas Unleashed
989K views · 11K reactions | 🏃‍♂️🔣💡 Excel's Flash Fill feature can quickly separate First Name, Middle Name, and Last Name from a full name, or even First Name, Initial, and Last Name, saving you time a | Excel Formulas Unleashed

This will sort the last names in ascending order (A to Z). To sort in descending order (Z to A), change the second argument to -1:

=SORT(B1:B5, -1)

Sorting by Last Name and Then by First Name

Merge First Name and Last Name in Excel | Full Name in Excel |My Coaching Classes
Merge First Name and Last Name in Excel | Full Name in Excel |My Coaching Classes

If you want to sort by last name and then by first name, use the following formula:

=SORT(B1:B5, 1, 2)

How to Alphabetize in Excel - The Complete Guide
How to Alphabetize in Excel - The Complete Guide
Excel formulas
Excel formulas
ms excel formula
ms excel formula
Excel Functions Cheat Sheet | 50+ Essential Formulas Every Beginner Should Know
Excel Functions Cheat Sheet | 50+ Essential Formulas Every Beginner Should Know
Excel Formulas
Excel Formulas
Excel Formulas You Should Know
Excel Formulas You Should Know
Add letters to a series of numbers
Add letters to a series of numbers
Top 25 Basic Excel Formulas Every Beginner Must Know
Top 25 Basic Excel Formulas Every Beginner Must Know
Handling Names Excel
Handling Names Excel
81K views · 952 reactions | Wondering how to change all uppercase to lowercase in Excel? This quick guide shows the easiest way to convert capital letters into lowercase using Excel formulas—no VBA needed! Ho | Excel Formula Hub
81K views · 952 reactions | Wondering how to change all uppercase to lowercase in Excel? This quick guide shows the easiest way to convert capital letters into lowercase using Excel formulas—no VBA needed! Ho | Excel Formula Hub
The ABCs of Excel | Excel Cheatsheets
The ABCs of Excel | Excel Cheatsheets
the basic excel formats for each type of document, including numbers and letters on it
the basic excel formats for each type of document, including numbers and letters on it
How to Create an Email Address with First Initial and Last Name Using Excel Formulas (3 Methods) - ExcelDemy
How to Create an Email Address with First Initial and Last Name Using Excel Formulas (3 Methods) - ExcelDemy
the next 10 excel formulas are available for use on any computer or other device
the next 10 excel formulas are available for use on any computer or other device
a spiral notebook with the text ms excel formulas written in black and white on it
a spiral notebook with the text ms excel formulas written in black and white on it
Excel Must-Know Formulas
Excel Must-Know Formulas
Top 5 Excel Formulas Every Beginner Should Know | SUM, AVERAGE, COUNT, MAX & MIN
Top 5 Excel Formulas Every Beginner Should Know | SUM, AVERAGE, COUNT, MAX & MIN
Excel formulas
Excel formulas
Excel formulas
Excel formulas
the basic formula for excel formats
the basic formula for excel formats

Here, 1 represents sorting by the first column (Last Name), and 2 represents sorting by the second column (First Name).

Using the INDEX and MATCH Functions

Another way to alphabetize by last name is by using the INDEX and MATCH functions together. This method is useful when you want to create a dynamic list of unique last names and their corresponding first names.

Creating a List of Unique Last Names

To create a list of unique last names, use the UNIQUE function:

=UNIQUE(B1:B5)

Using INDEX and MATCH to Retrieve First Names

Now, to retrieve the corresponding first names, use the INDEX and MATCH functions together. Assuming your unique last names start from E1, enter this formula in F1 and drag it down:

=INDEX(A1:A5, MATCH(E1, B1:B5, 0))

This will return the first names corresponding to the unique last names in column E.

In conclusion, Excel provides several ways to alphabetize by last name, from the simple SORT function to the more dynamic INDEX and MATCH combination. Each method has its use cases, allowing you to choose the one that best fits your needs. Happy sorting!