BBampaa

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 →
About 5–10 minutes · no sign-up needed

Example

TRIM removes the spaces at the start and end, and squeezes double spaces in the middle to one:

=TRIM(A2)

Typed into cell D2 of this sheet:

NameCityPhoneCleanOutput
ada obilagos 0803-555-1234
TUNDE BAKARE ABUJA0706-555-9876
grace ezeabuja0812-555-4433
Musa BelloKano0901-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

Try each one in your head first, then open the answer.

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 →
About 5–10 minutes · no sign-up needed