How to split first and last names in Excel with formulas

You will learn to pull first names and last names out of a column of full names using Excel formulas, so you never retype a list by hand. It suits anyone tidying customer or employee lists. You need Excel with the TEXTBEFORE and TEXTAFTER functions, or a fallback formula for older versions.

YouTube video: Excel Trick: Extract First & Last Names From Full Names in Seconds! 🤯 #excel #tutorial #howto

Caption availability is unknown. Check the CC control in the YouTube player.

Video length
2 min 50 s
Time to do it
5 minutes
Difficulty
Easy
Steps
7

What you need

Steps

  1. Put your full names in one column, for example column A starting at A2. Leave the next two columns free for first and last names.

  2. Click the first empty cell beside the first name, such as B2. This is where the first name formula goes.

  3. Type =TEXTBEFORE(A2," ") and press Enter. This returns everything before the first space, which is the first name.

  4. In C2, type =TEXTAFTER(A2," ") and press Enter. This returns everything after the first space, which is the last name.

  5. Drag the fill handle down from B2 and C2 to copy both formulas to every row. The names split instantly.

  6. If you see a #NAME? error, your Excel is older. Use =LEFT(A2,FIND(" ",A2)-1) for the first name and =MID(A2,FIND(" ",A2)+1,100) for the last name instead.

  7. Select both new columns, copy them, then paste as Values to replace the formulas with plain text. Delete the original full name column if you no longer need it.

Tips and common mistakes

Names with a middle name will put the middle and last name together in the last name column, so check those rows by hand.

Extra spaces break the split. Run Data, then Text to Columns, or use TRIM on the name column first.

Save a copy of the sheet before pasting values over your formulas in case you need to redo the split.

Questions

Why do I get a #NAME? error?

TEXTBEFORE and TEXTAFTER only exist in newer Excel versions. Use the LEFT, FIND and MID formulas in step 6 instead.

Can I split names with a comma like Smith, John?

Yes. Use =TEXTBEFORE(A2,",") for the last name and =TRIM(TEXTAFTER(A2,",")) for the first name.

Does this work in Google Sheets?

TEXTBEFORE and TEXTAFTER now work in Google Sheets too. Otherwise use the SPLIT function on the space.

The notes are drafted automatically from video details and general task knowledge. How the guide was prepared

Report a correction

More in Money & Office

See all