How to sort alphabetically in excel by last name
Tutor 5 (22 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To sort alphabetically in Excel by last name, you must first ensure that Excel can recognize the last name separately from the first name. Excel sorts data based on the cell content, so separating last names is necessary when names are in a "First Last" format.
Step 1: Separate Last Names
-
Suppose the full names are in column A, starting from cell A2.
-
Insert a new column B next to the full names.
-
In cell B2, enter the following formula to extract the last name:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
-
Press Enter. This formula finds the last word in the full name, assuming the last word is the last name.
-
Drag the formula down to apply it to all rows in column B.
Step 2: Sort by Last Name
-
Select all the data, including both columns (full names and last names).
-
Go to the Data tab on the Excel ribbon.
-
Click Sort.
-
In the Sort dialog box:
-
For Sort by, choose the column containing the last names (column B).
-
Choose Sort On → Cell Values.
-
Choose Order → A to Z for ascending order or Z to A for descending order.
-
-
Click OK. The data will now be sorted alphabetically by last name.
Step 3: Remove Helper Column (Optional)
-
After sorting, you can delete the helper column B if you no longer need it.
-
The full names in column A will remain sorted by last name.
Notes
-
If names contain middle names or multiple spaces, the formula still captures the last word as the last name.
-
On Mac, the steps are the same, but the Sort dialog may appear slightly different. Ensure the correct column is selected for sorting.
-
This method works for lists with hundreds or thousands of names efficiently.
This approach ensures accurate alphabetical sorting by last name without manually separating each entry.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to sort by highlighted cells in excel
Answers · 1
How to sort excel by column and keep rows together
Answers · 1
How to sort by time in excel
Answers · 1
How to sort alphabetically in excel by last name
Answers · 1