Table of Contents
In Excel, sorting by last name is a simple process that can help organize large sets of data. To do so, first select the column containing the names. Then, click on the “Data” tab and select the “Sort” option. In the Sort dialog box, choose the column containing the last names in the “Sort by” drop-down menu. Select “A to Z” for ascending order or “Z to A” for descending order. Finally, click “OK” to apply the sorting. This will arrange the data alphabetically by last name, making it easier to navigate and analyze.
Sort by Last Name in Excel (With Example)
You can use a simple two-step process to sort rows based on last name in Excel:
Step 1: Create new column that contains last name.
Step 2: Use Sort feature to sort by last name.
The following step-by-step example shows how to sort rows by last name in Excel in practice.
Step 1: Enter the Names
Suppose we have the following list of names in Excel:

Step 2: Create New Column that Contains Last Name
We can use the following formula to extract the last name from each full name:
=RIGHT(A2,LEN(A2)-FIND("*",SUBSTITUTE(A2," ","*",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))We can type this formula into cell B2, then drag and fill it down to the remaining cells in column B:

Column B now contains the last name of each full name in column A.
Notice that the formula works whether or not the name contains a middle name.
Note: This formula works by replacing the last space in the name with an asterisk ( * ) and then uses the FIND function to locate the asterisk and extract a certain number of characters in the name from the right.
Step 3: Sort by Last Name
Lastly, we can highlight the range A1:B11, then click the Data tab and then click the Sort icon within the Sort & Filter group:

In the new window that appears, choose the column titled Last Name in the dropdown menu for Sort by:

Once you click OK, the rows will be sorted by last name from A to Z:

Note that you can also delete the column titled Last Name if you don’t actually want to keep a separate column with the last names of each person.
The following tutorials explain how to perform other common tasks in Excel:
Cite this article
stats writer (2024). How do I sort by last name in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-i-sort-by-last-name-in-excel/
stats writer. "How do I sort by last name in Excel?." PSYCHOLOGICAL SCALES, 23 Jun. 2024, https://scales.arabpsychology.com/stats/how-do-i-sort-by-last-name-in-excel/.
stats writer. "How do I sort by last name in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-i-sort-by-last-name-in-excel/.
stats writer (2024) 'How do I sort by last name in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-i-sort-by-last-name-in-excel/.
[1] stats writer, "How do I sort by last name in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How do I sort by last name in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
