Joining and cleaning text
Glue text with &, change case with UPPER and LOWER, and TRIM extra spaces.
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.
- =A2&" "&B2 — First name, a space, last name
- Maya Ortiz — The joined text
- =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.