ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 48 · Working with text

Cleaning text in Excel

Data pasted from other places is often messy. TRIM removes extra spaces, PROPER fixes capital letters, UPPER and LOWER change case, and LEN counts characters.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Remove extra spaces and fix capital letters
  • Put one function inside another

How it works

TRIM removes extra spaces. PROPER fixes the capital letters. UPPER makes everything capitals. LEN counts the characters.

You can put one function inside another, like =PROPER(TRIM(A2)). The inside one goes first.

Formulas at a glance

=PROPER(TRIM(A2))trim, then capitalize
=LEN(B2)character count

Example

Write the formula to clean up the name in A2: remove extra spaces and fix the capitals.

ABCD
1Raw nameClean nameLengthUpper
2 maya chen
3LUIS ORTEGA
4priya natarajan
5 sam OKAFOR

Click B2 and type =PROPER(TRIM(A2)), then press Enter.

The answer is Maya Chen.

When to use it

  • Cleaning names typed in many styles
  • Removing extra spaces before a lookup
  • Checking the length of codes or phone numbers

Common mistakes

  • Expecting TRIM to remove every spaceTRIM keeps one space between words.
  • Putting the functions in the wrong orderThe inside function runs first: =PROPER(TRIM(A2)).
  • Editing the original dataClean in a new column, then copy the values back if you need to.

Quick check

What does TRIM remove?

  1. All spaces
  2. Extra spaces
  3. Capital letters
  4. Numbers
Show the answer

B. Extra spaces It removes spaces at the start and end, and extra spaces between words.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

Cleaning text in Excel: how it works, with examples · ExcelUnpack