DataTools AI DataTools AI

How to clean up names in Google Sheets

Names typed into forms come back as JUAN PEREZ, maria lopez or Ana de la Cruz with stray spaces. They look messy in mail merges and hide duplicates.

Step 1: remove extra spaces

=TRIM(A2) removes leading, trailing and repeated spaces. Text pasted from the web may contain non-breaking spaces; use =TRIM(SUBSTITUTE(A2,CHAR(160)," ")).

Step 2: fix capitalization

=PROPER(TRIM(A2)) turns JUAN PEREZ into Juan Perez. It keeps accents (josé → José).

Step 3: keep particles lowercase

PROPER writes Ana De La Cruz. To keep de, del, la, van, von lowercase, chain one REGEXREPLACE per particle: =REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(PROPER(TRIM(A2))," De "," de ")," Del "," del ")," La "," la ").

Step 4: split first and last name

=SPLIT(B2," ") splits on every space, which breaks compound surnames. A safer split for "first name + the rest": =REGEXEXTRACT(B2,"^\S+") and =REGEXEXTRACT(B2,"^\S+\s+(.*)$").

Watch out for

Names like McDonald, O'Brien or brand names written in capitals on purpose. Review a sample before replacing the original column.

Doing this every week? CleanSheet does all of these steps in one click: removes duplicates (even "Juan Perez" vs "juan pérez"), fixes name capitalization, formats phones to E.164, lowercases emails and standardizes dates and addresses. Free up to 500 rows. See CleanSheet · Get the $9 template