← Excel and spreadsheets

Joining and cleaning text

Glue text with &, change case with UPPER and LOWER, and TRIM extra spaces.

Start this lesson

The & sign joins text: =A2&" "&B2 puts a first name, a space and a last name together. CONCAT does the same job. Spaces and punctuation only appear if you put them in quotes. UPPER and LOWER change capital letters. TRIM removes spaces at the start and end and squeezes repeated spaces inside down to one.

Example: A2 is Maya and B2 is Ortiz.

  1. =A2&" "&B2 — First name, a space, last name
  2. Maya Ortiz — The joined text
  3. =UPPER(B2)&", "&A2 gives ORTIZ, Maya — Change case, add a comma

Why it works: The and sign glues pieces end to end with nothing in between, so any space or comma must be added in quotes. TRIM keeps one space between words so the words stay apart.

Tip: Data pasted from websites often has extra spaces; wrap it in TRIM before you look it up or compare it.