Sorting data in Microsoft Excel is usually done by first name when full names are stored in a single column. However, in many datasets, it is more useful to sort records by last name. Since Excel treats the full name as one text value, you first need to extract or separate the last name. This can be done using features like Flash Fill, Find and Replace, or Text to Columns, after which the data can be sorted alphabetically by last name.
Method 1: Sort Using Flash Fill
Flash Fill is an addition to Microsoft Excel 2013 that will automatically fill your data when it senses a pattern. For example, Flash Fill can separate first and last names from a single column or combine first and last names from two different columns.
Note: Flash Fill feature is added in MS Excel 2013 and it will be available in 2013 and later versions of excel.
For Example:
Step 1: Write the last name from the names given in the list to
cell D1. Write at least 2 last names into column D. (as shown below).
Step 2: Select both cells and hover the cursor over the bottom-right part of the selection(as shown in a circle below). You will notice that the cursor changes to a plus icon.
Step 3: Drag the plus icon to the last entry of your data. You'll notice an AutoFill Option (Marked in a circle below, Fig.1 ). Click on the AutoFill option, and a drop-down menu will appear in which you have to select Flash Fill (Fig. 2).
You'll see all the last names are now in column D.
Step 4: Select the entire dataset and click on Data Tab> Sort & Filter > Sort (as shown below).

Step 5: A dialogue box will appear(as shown below). In the Sort by option add the column name, here column name to be sorted is D. In the Order option, select the order in which you want to sort your data, and in Sort On option select values because we have text as values in the cell. Click OK
Output: The data will be sorted alphabetically according to last names. Delete the last names written in Column D and you'll get the desired output.
Method 2: Sort Using Find and Replace
As the name suggests, Find and Replace is a functionality that helps us to find a value or number in the sheet and replace it with the desired number or value. It is used when we have mistakenly typed the wrong spelling everywhere in the sheet and need to correct it. It will take a lot of time to find the wrong spelling one by one and then replace it. The example would be taken as above.
Step 1: Copy the data that needs to be sorted into the adjacent column. (as shown below)
Step 2: Select the copied data, in our example select the data from column D and press Ctrl+F to open the find and replace dialogue box (as shown below).
Step 3: In the dialogue box open the Replace option and put an asterisk (*) followed by a single space in Find what field. Leave the Replace with empty. And press Replace All (as shown above). The output will only have last names in the D column.
Note: The above steps work well even when you have middle names or prefixes (such as Mr. or Ms) in your data. It will only return last names.
Step 4: Select the entire dataset and click on Data Tab> Sort & Filter > Sort (as shown below).

Step 5: A dialogue box will appear(as shown below). In the Sort by option add the column name, here column name to be sorted is D. In the Order option, select the order in which you want to sort your data, and in Sort On option select values because we have text as values in the cell. Click OK.
Output: The data will be sorted alphabetically according to last names. Delete the last names written in Column D and you'll get the desired output.
Method 3: Sort Using Text to Columns
Text to Columns is a function provided by MS Excel that helps you to split text written in one cell into multiple cells. The example would be the same.
Step 1: Select the data and go to Data Tab>Sort & Filter> Text to Columns

Step 2: A dialogue box will appear(as shown below). Select Delimited and press Next> button.
Step 3: Click on Space, if your delimiter is a comma or semicolon instead of space click on that. Now click Next> (as shown below).
Step 4: Select General in Column data format and add the cell value adjacent to the original data in Destination and click Finish.
The output will look like this.
Now repeat steps 4 and 5 from Sort using Flash Fill and you'll be done. But remember now your data through which you want to sort is in Column E.