TidyRow

Nothing uploaded

How to separate first and last name in Google Sheets

Google Sheets can split names with a menu option or a formula. Both work for tidy lists, and messy ones need extra steps. Paste a column into the box below for a quick answer, or scroll down for the formulas.

Show me how to do it myself or use the tool below.

Example

MARY ann LEE

Mary Ann | Lee

Free name splitter

Runs in your browser. Nothing is uploaded.

First name and last name

Cleaning a whole spreadsheet? Drop the file in below.

Add your file

A CSV or Excel file exported from your store, CRM, email tool or spreadsheet.

Want proof nothing is uploaded? Once this page has loaded, turn off your Wi-Fi. It still works.

Check what we fixed

Names, phone numbers, emails and duplicates are fixed for you.

Download your clean file

Method 1: Split text to columns

  1. Make sure the columns to the right of your names are empty.
  2. Select the name column, then go to Data → Split text to columns.
  3. In the separator box that appears, choose Space.

Catch: it is a one-time split, so it does not update if a name changes. Middle names spill into a third column, and capitals and titles are not fixed.

Method 2: The SPLIT formula

With the full name in cell A2:

Split into columns
=SPLIT(PROPER(TRIM(A2)), " ")
First name only
=INDEX(SPLIT(TRIM(A2), " "), 1, 1)
Last name only
=INDEX(SPLIT(TRIM(A2), " "), 1, COUNTA(SPLIT(TRIM(A2), " ")))

TRIM removes extra spaces and PROPER fixes capitals. Titles like “Mr” or “Dr.” still end up as the first name.

Split a whole column at once

Instead of dragging a formula down, put one formula in B2 and it fills every row of column A:

First and last, whole column
=ARRAYFORMULA(SPLIT(PROPER(TRIM(A2:A)), " "))
First name, whole column
=ARRAYFORMULA(IF(A2:A="", "", REGEXEXTRACT(TRIM(A2:A), "^\S+")))
Last name, whole column
=ARRAYFORMULA(IF(A2:A="", "", REGEXEXTRACT(TRIM(A2:A), "\S+$")))

If you see “Array result was not expanded because it would overwrite data”, there is something in the cells to the right. Clear them and it will fill.

Names with a middle name

These three formulas give first, middle and last as separate columns. Put the name in A2:

First name
=REGEXEXTRACT(TRIM(A2), "^\S+")
Middle name (blank if none)
=TRIM(REGEXREPLACE(TRIM(A2), "^\S+|\S+$", ""))
Last name
=REGEXEXTRACT(TRIM(A2), "\S+$")

Catch: a name like “Juan de la Cruz” puts “de la” in the middle column, because the formulas split on spaces. TidyRow keeps “de la Cruz” together as the last name.

Names written “Last, First”

If your list reads “Hopper, Grace”, split on the comma and trim the space:

Last and first in two columns
=ARRAYFORMULA(TRIM(SPLIT(A2, ",")))
First name only
=TRIM(REGEXEXTRACT(A2, ",(.*)$"))
Last name only
=TRIM(REGEXEXTRACT(A2, "^([^,]+),"))

The first formula returns the last name in the first column and the first name in the second, in the same order as the original.

Removing titles like Mr and Dr

Strip a leading title before you split:

Remove a title
=REGEXREPLACE(TRIM(A2), "(?i)^(mr|mrs|ms|miss|dr|prof)\.?\s+", "")

Then use any of the formulas above on the result. Add more titles inside the brackets, separated by |.

Or skip the formulas

  1. Select the name column in Google Sheets and copy it.
  2. Paste it into the box at the top of this page.
  3. Click “Copy for Excel”, then paste the result back into your sheet. It works for Google Sheets too.
  • Capitals, extra spaces and titles fixed in one go
  • Surnames like “de la Cruz” kept together
  • Works for “Last, First” lists too
  • Free for up to 100 rows, and nothing is uploaded

Cleaning a whole contact sheet?

  1. In Google Sheets, go to File → Download → Comma-separated values (.csv).
  2. Drop the file onto the cleaner above the formulas.
  3. Download the cleaned file and import it back with File → Import.
  • Phone numbers and emails get cleaned at the same time, and duplicate rows are removed

Frequently asked questions

Why does SPLIT give me three columns?

Because the name has a middle name, or a title like “Dr.”. Use the first-name and last-name formulas above to pick just the first and last word, or paste the column into the tool at the top of the page.

How do I split first, middle and last name in Google Sheets?

Use the three formulas in the “Names with a middle name” section: one pulls the first word, one the last word, and one whatever is left in between.

How do I separate names that are written with a comma?

Use =ARRAYFORMULA(TRIM(SPLIT(A2, ","))). It splits at the comma and removes the space after it.

Why does it say “Array result was not expanded”?

The formula needs room to fill the cells to its right, and something is already in them. Clear those cells, or move the formula to an empty column.

Can TidyRow read my Google Sheet directly?

Not directly. Copy the column and paste it into the box, or download the sheet as a CSV (File → Download → .csv). Keeping it a copy or a file is what lets TidyRow clean it without uploading anything.

Does it handle names like Maria del Carmen Ruiz?

Mostly. It keeps common surname particles like “de la” and “van der” together, but a few long Spanish and Portuguese names are still split in the wrong place. Check those rows in the preview before you download.

Other clean-ups