Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Excel»How to Sort By Last Name in Excel? 5 Best Ways

    How to Sort By Last Name in Excel? 5 Best Ways

    Nisha GurungBy Nisha GurungFebruary 4, 2024 Excel 5 Mins Read

    When arranging full names in Excel, you may find the need to reorder them by Last Name, especially when you have to emphasize the Family Name.

    But, while sorting data, Excel always takes the first word or text string as a sort order. So, when you have a Full Name, it means that the names are alphabetized by First Name.

    However, we have 5 easiest workarounds to help you reorder by Last Name. 

    Using Flash Fill

    If you enjoy Excel’s Flash Fill, I have good news as you can use it to rearrange data by Last Name. But, it’s best only when you have a few names.

    In the next column, type the Names in Last, First order and press Enter. The Flash-fill will automatically suggest you fill the cells in the same pattern.

    Once you have entire names, go to the Data Tab. Click on the A to Z menu. You will have data sorted by last name.

    Selected the Sorted column. Right-click on it and click Delete.

    As I mentioned earlier, this approach is best for only a small dataset as it could be redundant over time and bore users.

    Using Find And Replace

    Another way to sort by family name is using the Find and Replace tool. Here, we will insert a new helper column with last names only.

    Then, set it as Sort by in the Sort window. You can delete that extra column once you’re done. 

    1. First, copy-paste the Names into your Adjacent Column.
      Copy-Paste Names in Adjacent Column
    2. Now, select your Names. Then, press Ctrl + H Find and Replace Menu Shortcut. 
    3. On Find What, type the Asterisk sign and Space key.
      On Find What, type Asterisk and Space
    4. On Replace with, leave the field empty and click Replace All. Now, you will only see Last Names in the Column.
      click Replace All
    5. Select All Data. From the Data tab, click the Sort button.
      From the Data tab, click Sort
    6. On Sort by, choose Last Name. On Order, choose A to Z or Z to A and click OK.
      Choose Last Name and Sort Order
    7. Finally, you can delete the Last Name column.

    Using Text to Columns

    The Find and Replace is useful when your Names have space in between them.

    But, Let’s say your Names are separated with a comma or dash delimiters. If that’s the case, you could opt for Excel’s Text to Columns Wizard to split columns and then reorder the names by last name. 

    1. Firstly, select the Ranges with Names. 
    2. On the Data Tab, click Text to Columns.
      On the Data Tab, click Text to Columns
    3. In Step 1, hit Next.
      hit Next
    4. On Step 2, tick any one Delimiters option. If you don’t see your Delimiter, tick Other and type the sign. Choose Next.
      Tick Delimiters and choose Next
    5. While the First Name is selected, choose Do not import column. Select Cell range in Destination and hit Finish.
      choose Do not import column and hit Finish
    6. Now, select all. On Data, click Sort. On Sort By, select the Last Name Column. Pick your Sort Order, and click OK.
      Choose Sort By, Order in Sort
    7. Here are the Sorted Names. Delete the Last Name if you want.
      Sorted Names

    Using Power Query

    If you don’t want to copy-paste, add new columns, etc in your sheet, I have more simpler way of sorting the data.

    This time we will load the Names into the Power Query Editor tool and perform everything there that takes only a few clicks.

    1. Select your data. 
    2. In the Data Tab, click on From Table/Range. Choose OK on the prompt.
      In the Data Tab, click on From Table-Range
    3. Now, on the Power Query Editor tool, select the Names Column. In-Home Tab, click Split Column > By Delimiter.
      click Split Column -By Delimiter
    4. On the Split Column by Delimiter window, select delimiter and hit OK.
      select delimiter and hit OK
    5. Now, select the Last Name Column and click Sort Option in the Home tab.
      select the Last Name Column and click Sort Option
    6. Finally, to merge the names again, select both columns. Go to the Transform tab and click on Merge Columns.
      Go to the Transform tab and click on Merge Columns
    7. On Merge Columns, pick Separator and click OK.
      pick Separator and click OK
    8. Select the Merged Column. Head back to the Home Tab and click Close & Load > Close & Load To.
      click Close & Load -Close & Load To
    9. On Import Data, choose Location to load data and hit OK.
      choose Location to load data and hit OK

    Using Formula

    Next, you could also split and merge columns using the Formula in Excel. However, to reorder the data, we will use the same Sort button.

    Although the steps are long, it’s more dynamic than the rest of the methods mentioned above. 

    Suppose, I have a list of Full Names in Column D. I will enter each formula to extract the First and Last Names separately in Column F and G respectively.

    ExtractFormulaDescription
    First Name=LEFT(D3, SEARCH(” “, D3)-1)Using the SEARCH and LEFT nested formula, we will return the text before the space in D3 from the left side.

    We got Sean as a Result.
    Last Name=RIGHT(D3,LEN(D3)-SEARCH(” “,D3))Here, we have specified the formula to return the texts from the right after the space.

    It resulted in Myers. 

    Then, extend the Fill Handle.  

    Now, using the Ampersand Operator, we will combine the Names in the Last, First order separated by a comma. After that use the Auto-Fill to fill in the remaining cells.

    Formula: 

    =G3&", " &F3

    Copy-paste the Column as Values Only. Now, select the Column Range. Right-click on Column > Sort. In the Context menu, click A to Z or Z to A. It’ll sort your column by Last Name.

    Lastly, you can separate the sorted Names with Text to Columns.

    After that, use Concat to combine those names as First Name, Last Name.

    Excel Basics
    Nisha Gurung

      As a Business Student, Nisha first used Excel to outline data trends for her college projects. Later, she started exploring basic Excel functions when she realized it is a powerful tool for all businesses today. Nisha believes she can relate to many of the issues users face when starting their Excel Journey. She uses this knowledge and experience to curate contents that are fit for all types of Excel users. Apart from writing, she enjoys reading books and traveling.

      Related Posts

      Excel By Nisha Gurung

      How to Compare Two Columns in Excel Using VLOOKUP

      Excel By Nisha Gurung

      How to Share Excel Files with Multiple Users

      Excel By Nisha Gurung

      How to Filter Based on a List in Excel

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • Using Flash Fill
      • Using Find And Replace
      • Using Text to Columns
      • Using Power Query
      • Using Formula
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.