Fix messy names with PROPER and TRIM
PremiumThe name in A2 has extra spaces and the wrong capitals. In B2, clean it up to "Maria Lopez". Put TRIM inside PROPER.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Name as typed | Name | ||||
| 2 | mARIA lOPEZ | |||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
Premium lesson
Unlock TRIM, PROPER and UPPER and every other lesson
This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.
Next with premium:LEFT, RIGHT and MIDFIND and SEARCH
Need help?
Why this works
TRIM(A2) removes the spaces at both ends and squeezes the three spaces in the middle down to one, giving "mARIA lOPEZ". PROPER then capitalizes the first letter of each word and makes the rest lowercase: "Maria Lopez".
Common mistake: Fixing the capitals and forgetting the spaces. The name looks almost right, but " Maria Lopez " won't match "Maria Lopez" in a lookup.
The answer
- B2
=PROPER(TRIM(A2))
Use PROPER, which capitalizes the first letter of each word. =PROPER(TRIM(A2)) also removes the extra spaces.