How to split full names into first and last name in Sheets
Many businesses store employee or client names in a single column, which makes sorting, mail‑merge and reporting difficult. Google Sheets provides powerful text functions that can break a name into its components, but the order of operations matters. This guide walks you through a reliable formula chain that works for most Western name formats.
Why this is harder than it looks
People often try to split names by simply using SPLIT on a space, only to end up with extra columns for middle names, titles or suffixes. Others copy‑paste values and lose the original data, or they apply a formula to a few rows and then drag it down incorrectly, causing #REF! errors. The result is a messy sheet that still requires manual cleanup.
Step by step
- Detect the delimiter and trim extra spaces. Start by cleaning the source column. In a new column enter =TRIM(A2) to remove leading or trailing spaces. If names use commas (e.g., "Doe, John"), replace the comma with a space using =SUBSTITUTE(TRIM(A2),"," ," "). This creates a uniform space‑separated string for the next steps.
- Extract the first name. Use =INDEX(SPLIT(B2," "),1) where B2 holds the cleaned string. SPLIT breaks the text at each space, and INDEX returns the first element, which is usually the given name. This works even when the original name contains a middle name because only the first token is selected.
- Extract the last name. Place =INDEX(SPLIT(B2," "),COUNTA(SPLIT(B2," "))) in the last‑name column. COUNTA counts how many tokens SPLIT produced, and INDEX with that count returns the final token, handling names with one or many middle parts. If a suffix like "Jr." appears, it will be captured here; handle it later if needed.
- Handle middle names, prefixes and suffixes. If you need a separate middle‑name column, use =JOIN(" ",ARRAY_CONSTRAIN(SPLIT(B2," "),1,COUNTA(SPLIT(B2," "))-2)). This joins all tokens between the first and last, leaving out common prefixes (Mr., Dr.) that you can strip with =IF(LEFT(C2,3)="Mr","",C2) or similar checks. For suffixes, test the last token against a list ("Jr","Sr","III") and move it to a suffix column.
- Copy formulas down without breaking references. Select the cells with the formulas, then double‑click the fill handle (small square at the cell's bottom‑right) to auto‑fill down to the last adjacent row. This method respects relative references, so each row processes its own source cell. After filling, copy the result columns and use Paste > Paste values only to lock the split data.
Common mistakes
- Using SPLIT on a single space when the name contains commas
- Dragging formulas over blank rows, which creates #N/A errors
- Overwriting the original column before saving a backup
Where ContactName Workbench fits in
ContactName Workbench is a Google Workspace Editor add‑on for Sheets that adds a custom menu to parse full names automatically. With one click it creates first‑name, middle‑name and last‑name columns, handling common prefixes, suffixes and multiple middle parts, so you can skip the manual formula steps described above.
ContactName Workbench support and FAQ
FAQ
Treat the hyphen as part of the first or last token. After cleaning the string, you can replace the hyphen with a non‑breaking space using SUBSTITUTE, or simply keep it; the SPLIT function only separates on spaces, so "Anne‑Marie" stays intact.
Yes. Google Sheets functions operate on Unicode strings, so accents, Cyrillic or Asian characters are handled the same way. Just ensure the delimiter is a space and that you trim any invisible zero‑width characters with TRIM.
The first‑name formula will return the whole word, and the last‑name formula will also return it because COUNTA counts one token. You can add an IF check: IF(COUNTA(SPLIT(B2," "))=1, "", INDEX(...)) to leave the last‑name cell blank.