How to Split First and Last Names in Excel (4 Easy Ways)

You have a column of full names like “Sara Ahmed” and need first and last names in separate columns. Excel gives you several ways to do it. Pick the one that matches your version and data.

MethodBest forUpdates automatically?
Flash FillQuick one-off jobsNo
Text to ColumnsLarge lists, any Excel versionNo
TEXTSPLITExcel 365Yes
LEFT/RIGHT/FIND formulasOlder Excel versionsYes

Method 1: Flash Fill (fastest)

  1. Names are in column A, starting at A2. In B2, type the first name exactly as it should appear, for example Sara.
  2. Click B3 and press Ctrl + E.
  3. Excel fills the rest of the column by following your pattern.
  4. Repeat in column C for the last name: type Ahmed in C2, then press Ctrl + E in C3.

Flash Fill is available in Excel 2013 and later. Check a few rows afterwards, especially names with three parts.

Method 2: Text to Columns

  1. Select the names in column A.
  2. Go to Data → Text to Columns.
  3. Choose Delimited and click Next.
  4. Tick Space and click Next.
  5. Set the Destination to B2 so your original column isn’t overwritten.
  6. Click Finish.

Each word goes into its own column. If a name has a middle name, you’ll get three columns for that row.

Method 3: TEXTSPLIT (Excel 365)

=TEXTSPLIT(A2, " ")

This splits the name at every space and spills the parts into the cells to the right. Because it’s a formula, the results update when the original name changes.

Make sure the cells to the right are empty, or you’ll see a #SPILL! error.

Method 4: Formulas (any Excel version)

First name (everything before the first space):

=LEFT(A2, FIND(" ", A2) - 1)

Last name (everything after the first space):

=MID(A2, FIND(" ", A2) + 1, 100)
Excel example splitting full names into first and last names with LEFT, FIND and MID
LEFT takes everything before the first space, and MID takes everything after it.

FIND locates the space, LEFT takes the characters before it, and MID takes everything after it. The 100 just means “up to 100 characters.”

In Excel 365 you can use simpler functions:

=TEXTBEFORE(A2, " ")
=TEXTAFTER(A2, " ", -1)

The -1 in TEXTAFTER means “after the last space”, which gives the last word even when there’s a middle name.

Dealing with messy data

  • Extra spaces: clean them first with =TRIM(A2), otherwise you’ll get empty columns.
  • “Last, First” format: split on a comma instead. In Text to Columns, tick Comma; with TEXTSPLIT use =TEXTSPLIT(A2, ", ").
  • Single names: FIND returns #VALUE! when there’s no space. Wrap the formula: =IFERROR(LEFT(A2, FIND(" ", A2)-1), A2).
  • Middle names: decide whether they belong with the first or last name, and use TEXTAFTER with -1 for the last word.

Combine names back together

To join first name (B2) and last name (C2) with a space:

=B2 & " " & C2

Or in Excel 2019 and later: =TEXTJOIN(" ", TRUE, B2:C2).

In Google Sheets

Use =SPLIT(A2, " "), or select the column and choose Data → Split text to columns. Google Sheets also suggests Smart Fill (similar to Flash Fill) when it spots a pattern.

Next, tidy your list further with How to Remove Duplicates in Excel.

Common mistakes

  • Overwriting the original column. Text to Columns writes over your data unless you set a different destination. Use B2.
  • Not cleaning spaces first. Double spaces create empty columns or wrong splits. Use TRIM first.
  • Assuming every name has two parts. Three-part names and single names break simple formulas. Check them.
  • No space for a spill. TEXTSPLIT needs empty cells to the right, or you get #SPILL!.
  • Forgetting Flash Fill doesn’t update. If the full names change, run Flash Fill again or use a formula.

Practice exercises

Put these names in A2:A5: Sara Ahmed, Noor Ali Hassan, Hassan, Noor and Fatima.

  1. Write a formula that returns the first name from A2.
  2. Write a formula that returns the last name from A2.
  3. For A3, what does =MID(A3, FIND(" ", A3) + 1, 100) return? Which Excel 365 formula returns only Hassan?
  4. Split A4 into Hassan and Noor in two cells with one formula.
  5. Write a first-name formula that returns Fatima for A5 instead of an error.

Answers

  1. =LEFT(A2, FIND(" ", A2) - 1) returns Sara.
  2. =MID(A2, FIND(" ", A2) + 1, 100) returns Ahmed.
  3. It returns Ali Hassan. =TEXTAFTER(A3, " ", -1) returns Hassan.
  4. =TEXTSPLIT(A4, ", ")
  5. =IFERROR(LEFT(A5, FIND(" ", A5) - 1), A5)

FAQ

Which method should I use?

Flash Fill for a quick one-off job, TEXTSPLIT or TEXTBEFORE/TEXTAFTER in Excel 365, and LEFT/MID/FIND in older versions.

How do I split names with a middle name?

Use TEXTBEFORE for the first name and TEXTAFTER with -1 for the last name. Everything in between is the middle name.

Why does Flash Fill not work?

It may not be turned on (File → Options → Advanced → Automatically Flash Fill), or it needs one or two more examples to see the pattern.

Can I split names in Power Query?

Yes. Use Split Column → By Delimiter. It’s a good choice when you get the same list every month.

Related guides

About the author

I’m Abdelazim Nasr, a software developer with more than 20 years of experience building business systems: general ledger reporting, fixed asset management and data synchronisation jobs, using SQL Server, Delphi, Laravel and MySQL. The guides and templates on SimplifyLearn come from that day-to-day work. Spotted a mistake? Let me know.

Leave a Comment