How to split first and last name in excel
Tutor 5 (120 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Splitting first and last names in Excel can be done using Text to
Columns, formulas, Flash Fill, or Power Query.
Using Text to Columns Feature
·
Select the column containing full names.
·
Navigate to the Data tab and
click Text to Columns.
·
Choose Delimited in Step 1 of
the wizard.
·
Select Space as the delimiter
in Step 2.
·
Specify the destination cells in Step 3.
·
Column A transforms into Column B (first names)
and Column C (last names).
·
Efficient for bulk operations: processes ~10,000
names in under 2 seconds on standard hardware.
Formula Method with Text Functions
=LEFT(A2,FIND(" ",A2)-1)
· Finds the first space in the cell and returns all characters to the left.
Extracting Last Names
Use the RIGHT, LEN, and FIND functions to extract last names:
=RIGHT(A2,LEN(A2)-FIND(" ",A2))
Calculates the remaining characters after the first space and extracts them.
Using Flash Fill
·
Press Ctrl+E (Windows) or Cmd+E
(Mac) to activate Flash Fill.
·
Excel auto-fills remaining rows based on the
pattern.
·
Repeat for last names in the next column.
·
Works best for standard name formats; achieves
~98% accuracy.
Handling Complex Name Formats
Names with Middle Names or Initials
·
First name extraction remains the same.
· For last names:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
Names with Prefixes or Suffixes
·
Type the first name manually in the adjacent
column (e.g., B2).
Extracts the last word while trimming excess spaces.
Remove prefixes/suffixes using SUBSTITUTE first:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"Dr. ",""),"Jr.",""),"III","")
Power Query Solution
Ideal for large datasets (>100,000 rows).
Select your data range, click Data → From Table/Range.
In Power Query Editor: Transform → Split Column → By Delimiter.
Choose Space as the delimiter and Each occurrence for multiple splits.
Efficient: processes 500,000 names in ~12 seconds.
Maintains dynamic links to source data; updates automatically on refresh.
Troubleshooting Common Issues
Extra Spaces in Data
Causes formula errors.
Single-Word Entries
Use TRIM(A2) before splitting to remove extra spaces.
Names without spaces produce #VALUE! errors.
Use IFERROR to handle:
=IFERROR(LEFT(A2,FIND(" ",A2)-1),A2)
Inconsistent Formatting
Mixed formats require conditional formulas based on space count:
=LEN(A2)-LEN(SUBSTITUTE(A2," ",""))
0 spaces → single name, 1 space → standard first/last, 2+ spaces → complex names
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to track changes in excel
Answers · 1
How to lock certain cells in excel
Answers · 1
How to merge two excel spreadsheets
Answers · 1
Where is the name box in excel
Answers · 1