ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Text
  3. How to Split First and Last Names in Excel

How to Split First and Last Names in Excel

By ExcelReady Team·Updated October 30, 2026·7 min read

The short answer

To split a full name in Excel, use =TEXTBEFORE(A2," ") for the first name and =TEXTAFTER(A2," ",-1) for the last name, which also handles middle names. In Excel 2021 and older, use =LEFT(A2,FIND(" ",A2)-1) for the first name. For a one-off job, Data > Text to Columns or Flash Fill splits names without formulas.

Key takeaways

  • Clean the names with TRIM first, so extra spaces don't create empty parts.
  • First name: =TEXTBEFORE(A2," "). Last name: =TEXTAFTER(A2," ",-1), which splits at the last space.
  • In older Excel: =LEFT(A2,FIND(" ",A2)-1) for the first name and =RIGHT(A2,LEN(A2)-FIND(" ",A2)) for a two-part name.
  • Text to Columns and Flash Fill are fast but don't update when the names change; formulas do.
  • Check the results by eye: suffixes, prefixes and single names need special handling.
On this page+
  1. Which method should you use to split names?
  2. Clean the names first with TRIM
  3. How to split names in Excel with TEXTBEFORE and TEXTAFTER
  4. How to split names in older Excel with LEFT and FIND
  5. How to split "Last, First" names
  6. How to split names without formulas
  7. Names that need a manual check
  8. Practise it

To split names in Excel into first and last name, split the text at the space: TEXTBEFORE gives the part before it and TEXTAFTER the part after it. In older versions, LEFT, RIGHT and FIND do the same job, and Text to Columns or Flash Fill work without any formula. This guide is for anyone tidying a contact or employee list, and it covers middle names, "Last, First" lists and the names that break simple formulas.

Which method should you use to split names?#

Pick a formula if the list will change, and a tool if it's a one-off job. Here are the options:

MethodExcel versionsUpdates when names change?Good for
TEXTBEFORE / TEXTAFTERMicrosoft 365, Excel 2024, Excel for the webYesThe simplest formulas
LEFT, RIGHT, MID with FINDAllYesFiles used in older Excel
TEXTSPLITMicrosoft 365, Excel 2024, Excel for the webYesEvery part in its own column
Text to ColumnsAllNoA quick one-off split
Flash FillExcel 2013 or newerNoUnusual patterns, by example

The examples use these names in column A:

ABC
1Full NameFirst NameLast Name
2Marco Luca BelliniMarcoBellini
3Dana WhitfieldDanaWhitfield
4Yuki TanakaYukiTanaka
5Samuel OkaforSamuelOkafor

Clean the names first with TRIM#

Extra spaces break every splitting method, so clean the names before you split them. A name like " Dana Whitfield" has spaces at the start and two in the middle; splitting at the first space gives an empty first name. TRIM removes spaces at both ends and squeezes the rest down to one:

Excel formula
=TRIM(A2)

Use the cleaned column as the source for your split formulas, or nest TRIM inside them. The TRIM function guide has more examples, and how to clean messy data covers capitals and hidden characters too.

How to split names in Excel with TEXTBEFORE and TEXTAFTER#

TEXTBEFORE returns the text before a delimiter, and TEXTAFTER the text after it. The delimiter here is a space, written " ". For the first name, in B2:

Excel formula
=TEXTBEFORE(A2," ")

For the last name, in C2, split at the last space with -1:

Excel formula
=TEXTAFTER(A2," ",-1)

For Marco Luca Bellini, the results are Marco and Bellini. The -1 matters: =TEXTAFTER(A2," ") splits at the first space and returns "Luca Bellini". Fill both formulas down (Windows: Ctrl+D; Mac: ⌘D).

How to get the middle name#

The middle name is what's left between the first and last spaces. Take everything after the first space, then everything before its last space:

Excel formula
=TEXTBEFORE(TEXTAFTER(A2," ")," ",-1,0,0,"")

For Marco Luca Bellini this returns Luca. For Dana Whitfield there's no second space, so the last argument, "", returns empty text instead of #N/A. See TEXTBEFORE and TEXTAFTER for all the arguments.

How to split names in older Excel with LEFT and FIND#

In Excel 2021 and older, find the space with FIND, then take the text around it. FIND returns the position of the space; for Dana Whitfield, =FIND(" ",A3) gives 5. The first name is one character shorter than that:

Excel formula
=LEFT(A3,FIND(" ",A3)-1)

For a two-part name, the last name is everything after the space. LEN counts all the characters, so subtract the space's position:

Excel formula
=RIGHT(A3,LEN(A3)-FIND(" ",A3))

Both return Dana and Whitfield. To understand the pieces, read how FIND and SEARCH find text in a cell and LEFT, RIGHT and MID explained; the LEFT function guide is a quick reference.

Last name with a middle name, in older Excel#

Without TEXTAFTER, getting the text after the last space takes a longer formula:

Excel formula
=RIGHT(A2,LEN(A2)-FIND("@",SUBSTITUTE(A2," ","@",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))

Read it from the inside out. LEN(A2)-LEN(SUBSTITUTE(A2," ","")) counts the spaces (2 for Marco Luca Bellini). SUBSTITUTE then swaps only that last space for an @, FIND gives its position (11), and RIGHT takes the 7 characters after it: Bellini. It works as long as the names don't contain @.

How to split "Last, First" names#

When names are stored as "Bellini, Marco", split at the comma instead. Include the space after the comma, or every first name will start with a space:

Excel formula
=TEXTAFTER(A2,", ")

That returns the first name, and =TEXTBEFORE(A2,",") returns the last name. In older Excel, use =LEFT(A2,FIND(",",A2)-1) for the last name and =MID(A2,FIND(",",A2)+2,LEN(A2)) for the first. The +2 skips both the comma and the space. To put the parts back as "Marco Bellini", join them with &; see how to combine text in Excel.

How to split names without formulas#

Text to Columns and Flash Fill split names in a few clicks, but the results are plain values. If a name changes later, you have to split it again.

Text to Columns:

  1. Select the names, for example A2:A5.
  2. Go to Data > Text to Columns.
  3. Choose Delimited, click Next, tick Space, and click Finish.

It overwrites the columns to the right, so make sure they're empty. A middle name ends up in its own column.

Flash Fill: type the first name for the first row (Marco in B2), move to B3, and press Ctrl+E on Windows, or use Data > Flash Fill on a Mac. Excel follows your example for the rest of the column. Check the results, since it guesses the pattern.

In Microsoft 365 there's also TEXTSPLIT: =TEXTSPLIT(A2," ") spills each part of the name into its own column.

Names that need a manual check#

No formula understands names, so check the results by eye. Watch for:

  • Single names, like "Cher": there's no space, so the formulas return #VALUE! or #N/A. Wrap them in IFERROR: =IFERROR(TEXTBEFORE(A2," "),A2).
  • Suffixes, like "Samuel Okafor Jr.": the last name comes out as Jr.
  • Multi-word surnames, like "Ana de la Cruz": splitting at the last space gives Cruz, not de la Cruz.

For a short list, fix these by hand after the split. For a long list, flag rows with more than one space using =LEN(A2)-LEN(SUBSTITUTE(A2," ",""))>1 and review them.

Practise it#

Practise TEXTBEFORE and TEXTAFTER in a live spreadsheet: split emails, flip "Last, First" names and use -1 for the last delimiter. Then practise LEFT, RIGHT, MID and LEN to build the older-Excel versions of the same formulas.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Get the last name, even when there is a middle name. Click C2 and use TEXTAFTER on A2 to return the text after the last space.

fx
ABCD
1
Full Name
First Name
Last Name
2
Marco Luca Bellini
3
Dana Whitfield
4
Yuki Tanaka
5
Samuel Okafor
6
Ingrid Larsen
7
8
9

Tip: The delimiter is a space in quotes. A third argument of -1 means the last one.

Practise this in a lesson

LessonTEXTBEFORE and TEXTAFTERSplit emails, "Last, First" names and file paths at a delimiter with TEXTBEFORE and TEXTAFTER, including picking which occurrence to split at.LessonLEFT, RIGHT, MID and LENSplit product codes and IDs into their parts by taking characters from the start, end or middle of the text.Function guideLEFTPull the first characters from a cell with Excel's LEFT: prefixes, initials and first names. Examples, pitfalls and live practice.Function guideTRIMClean imported data with Excel's TRIM: strip leading, trailing and double spaces so lookups and counts work. Examples and live practice.

Frequently asked questions

How do I separate first and last names in Excel?

+

In Microsoft 365, use =TEXTBEFORE(A2," ") for the first name and =TEXTAFTER(A2," ",-1) for the last name. In older Excel, use =LEFT(A2,FIND(" ",A2)-1) for the first name.

How do I get the last name when there is a middle name?

+

Split at the last space: =TEXTAFTER(A2," ",-1). For Marco Luca Bellini, it returns Bellini. The -1 means the last space instead of the first.

How do I split names without a formula?

+

Select the names, go to Data > Text to Columns, choose Delimited, tick Space and click Finish. Or type the first name next to the first row and use Flash Fill.

How do I split "Last, First" names?

+

Split at the comma and space: =TEXTAFTER(A2,", ") gives the first name and =TEXTBEFORE(A2,",") gives the last name.

Why does my name formula return #VALUE! or #N/A?

+

The cell has no space, usually because it holds a single name or is empty. Wrap the formula in IFERROR, as in =IFERROR(TEXTBEFORE(A2," "),A2), to return the whole cell instead.

Sources

  • TEXTAFTER function - Microsoft Support
  • TEXTBEFORE function - Microsoft Support
  • FIND, FINDB functions - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Which method should you use to split names?
  2. Clean the names first with TRIM
  3. How to split names in Excel with TEXTBEFORE and TEXTAFTER
  4. How to split names in older Excel with LEFT and FIND
  5. How to split "Last, First" names
  6. How to split names without formulas
  7. Names that need a manual check
  8. Practise it

Keep reading

Text· 6 min read

LEFT, RIGHT and MID in Excel: Pull Out Part of a Cell

LEFT, RIGHT and MID pull part of the text out of a cell. LEFT(text, num_chars) takes characters from the start, RIGHT(text, num_chars) takes them from the end, and MID(text, start_num, num_chars) takes them from any position. For TX-ELC-40512, LEFT(A2,2) gives TX, MID(A2,4,3) gives ELC and RIGHT(A2,5) gives 40512.

Text· 7 min read

Find the Position of Text in a Cell (FIND and SEARCH)

FIND and SEARCH return the position of some text inside a cell, as a number. =FIND(" ",A2) gives 5 for Dana Whitfield, because the space is the 5th character. FIND is case-sensitive; SEARCH ignores capitals and allows wildcards. Both return #VALUE! when the text isn't there, so wrap them in ISNUMBER to test whether a cell contains a word.

Text· 7 min read

How to Combine Text in Excel (&, CONCAT, TEXTJOIN)

To combine text in Excel, join the pieces with &: =A2&" "&B2 turns Nora and Delgado into Nora Delgado. CONCAT does the same with a list of pieces. TEXTJOIN puts the same separator between every piece and can skip empty cells: =TEXTJOIN(", ",TRUE,C2:E2). Type spaces and commas yourself, inside double quotes.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free