The examples assume full names like Maria Lopez are in column A starting at A2. Pick the method that fits your Excel version and how messy the names are.
$B$2 and click Finish.Names with a middle name split into three columns, so check the results. The output is static; it won't update if the names change.
Split on every space; the result spills across columns:
=TEXTSPLIT(A2," ")
For just first and last name, even when there's a middle name:
=TEXTBEFORE(A2," ")
=TEXTAFTER(A2," ",-1)
The -1 tells TEXTAFTER to use the last space, so "Maria J. Lopez" gives "Lopez". Wrap A2 in TRIM() if there are stray spaces.
First name (everything before the first space):
=LEFT(A2,FIND(" ",A2)-1)Everything after the first space (fine for two-word names):
=RIGHT(A2,LEN(A2)-FIND(" ",A2))Last word only, even with a middle name:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))This replaces each space with 100 spaces, takes the last 100 characters, and trims them, which leaves the last word. If some cells hold a single word, FIND returns an error; wrap the formula as =IFERROR(LEFT(A2,FIND(" ",A2)-1),A2).
For names like Lopez, Maria:
=LEFT(A2,FIND(",",A2)-1)=TRIM(MID(A2,FIND(",",A2)+1,LEN(A2)))The first gives the last name and the second gives the first name.
Maria.Flash Fill guesses from your example, so scan the results, especially for middle names, suffixes like Jr., and particles like "van der". Its output is static.
No method handles every name. Titles (Dr.), suffixes (Jr., III) and multi-part surnames need checking by hand or a smarter parser.
Data → Text to Columns with a space delimiter works in every version. Flash Fill (Excel 2013 and later) also works well for consistent names.
In Excel for Microsoft 365, TEXTSPLIT, TEXTBEFORE and TEXTAFTER. In any version, LEFT, RIGHT and FIND around the space.
Text to Columns and TEXTSPLIT create an extra column for each extra word; formulas based on the last space keep only the final word as the last name.
Skip the formulas: the free Split Names and Addresses tool does this in your browser. Nothing is uploaded.
Just starting out? Grab the free Starter Expense Tracker (pay what you want, $0 is fine).