Lessons › Excel & Google Sheets
Excel & Google Sheets lesson
TRIM
" ada obi" becomes "ada obi". Now it will match in a lookup.
Try this lesson free →Example
TRIM removes the spaces at the start and end, and squeezes double spaces in the middle to one:
=TRIM(A2)| Name | City | Phone | Clean | Output |
|---|---|---|---|---|
| ada obi | lagos | 0803-555-1234 | ||
| TUNDE BAKARE | ABUJA | 0706-555-9876 | ||
| grace eze | abuja | 0812-555-4433 | ||
| Musa Bello | Kano | 0901-555-2211 |
Key points
TRIMRemoves extra spaces: at the start, at the end, and doubled in the middle.
TRIM(A2)Give it the cell to clean.
Why it matters"Ada" and " Ada" look the same, but a lookup treats them as different.
Put together: =TRIM(A2). Clean the spaces first; it fixes more problems than you'd think.
Practice
1. In D3, remove the extra spaces from Tunde's name.
=TRIM(A3)2. In E3, remove the extra spaces from Tunde's city.
=TRIM(B3)3. In D4, remove the extra spaces from Grace's name.
=TRIM(A4)4. In D2, remove the extra spaces from Ada's name.
=TRIM(A2)5. In E2, remove the extra space from Ada's city.
=TRIM(B2)Learn it by doing. This lesson is a short hands-on level on Bampaa: see it work, then build and write it yourself, with instant feedback.
Try this lesson free →