Clean a code with UPPER and TRIM
PremiumIn B2, clean up the code in A2 so it has no extra spaces and is all capitals. Put TRIM inside UPPER.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code as typed | Code | ||||
| 2 | dk-4021 | |||||
| 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
Excel works from the inside out: TRIM(A2) gives "dk-4021" without the spaces, and UPPER turns that into "DK-4021". The other order, =TRIM(UPPER(A2)), gives the same result, because each function only does its own job.
Common mistake: Writing two helper columns, one for TRIM and one for UPPER. One cell can do both when one function sits inside the other.
The answer
- B2
=UPPER(TRIM(A2))