UPPER, LOWER, PROPER and TRIM: cleaning text in Excel
UPPER, LOWER and PROPER change capitalisation. TRIM removes extra spaces. Imported names and codes usually need both before lookups and counts work.
What does each function do?
For " aNA petroviĆ " in A2:
| Formula | Result |
|---|---|
=UPPER(TRIM(A2)) | ANA PETROVIĆ |
=LOWER(TRIM(A2)) | ana petrović |
=PROPER(TRIM(A2)) | Ana Petrović |
TRIM removes spaces at the start and end and turns double spaces inside the text into single ones.
Why does my VLOOKUP fail on values that look the same?
Often because one of them has a trailing space. Clean both sides with TRIM, or look for it with =LEN(A2).
Why doesn't TRIM remove every space?
Data from websites often contains non-breaking spaces (character 160), which TRIM ignores. Replace them first:
=TRIM(SUBSTITUTE(A2,CHAR(160)," "))
Where does PROPER go wrong?
It capitalises after every non-letter, so "o'neill" becomes "O'Neill" (good) but "mcdonald" becomes "Mcdonald" and "ABC ltd" becomes "Abc Ltd". Check names after using it.
Try it yourself. Practise this in a real spreadsheet in your browser, with instant feedback.
Practise UPPER, LOWER, PROPER Practise cleaning data
Practise UPPER, LOWER, PROPER Practise cleaning data
Updated November 2026.