How to Extract Last Name from Full Name Using Excel Formulas
Question details
The user needs a reliable Excel formula to extract only the last name from a full name text string.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Extracting the final word from a cell containing complex names, including multiple words, initials, or ampersands.
- Observed behavior
- Basic formulas using FIND return everything after the first space (e.g., returning 'L. & Susan A. Brown' instead of just 'Brown'), failing to isolate the final word correctly.
Ensure that your text data does not contain trailing spaces at the very end of the name, as this formula identifies the last actual space between words to extract the final word.
Use a Combination of TRIM, RIGHT, SUBSTITUTE, and REPT Formulas
This formula is the most reliable method for extracting the last word of a text string because it works backwards from the end of the text, avoiding issues with multiple middle spaces.
Because Excel evaluates text functions from left to right, standard FIND operations fail when encountering names with varying amounts of spaces. By replacing all spaces with a massive padding block, isolating the right side of the text, and trimming it, you reliably get the last string component.
Click on the cell where you want the extracted last name to be displayed (e.g., B37).
Type the formula =TRIM(RIGHT(SUBSTITUTE(A37," ",REPT(" ",LEN(A37))),LEN(A37))) into the formula bar. Replace A37 with the reference to your target cell.
Press Enter. Select the filled cell and double-click the fill handle in the bottom-right corner to copy the formula down your column.

Use Flash Fill for Formula-Free Extraction
If you prefer not to use formulas, Flash Fill is a quick built-in Excel feature that learns your text extraction pattern and applies it automatically.
Effortlessly Manage Text Data in WPS Spreadsheet
WPS Spreadsheet provides robust, professional-grade data manipulation tools. Whether you need complex nested formulas like TRIM and SUBSTITUTE or intelligent data features like Flash Fill, WPS handles your text extraction seamlessly.
- 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your spreadsheet document containing the list of full names.
- 2. Apply the extraction formula: Select a blank cell adjacent to the name and input the extraction formula: =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1))).
- 3. Fill the column: Press Enter to execute the formula, then grab the fill handle in the lower right corner of the cell and drag it downward to complete your list.

Frequently Asked Questions
Why does the FIND formula return everything after the first space?
The FIND and SEARCH functions in Excel evaluate text strings strictly from left to right. Once they hit the very first space, they stop searching. If you use a simple RIGHT and FIND combination, it calculates from that first space, causing it to return middle names, initials, and ampersands instead of isolating the final word.
Will this formula work if a name ends with a suffix like 'Jr.' or 'Sr.'?
Yes, but with a caveat. The formula strictly extracts whatever characters follow the absolute final space. If the name is 'John Smith Jr.', the formula will extract 'Jr.' instead of 'Smith'. For names with suffixes, you may need to use a cleaner dataset or more advanced nested IF statements.
How can I extract the first name instead of the last name?
Extracting the first name is much simpler because you only need to locate the first space. You can use the formula =LEFT(A1, FIND(" ", A1) - 1). This tells Excel to extract all text from the left until it hits the very first space character.




