TRIM Exercise: Remove Extra Spaces from Names

Reading time: 3 minutes

Extra spaces are invisible, but they break your formulas. “Smith ” with a space at the end is not equal to “Smith”, so a lookup fails and a count is wrong. TRIM removes the spaces at the start, at the end, and the double spaces in the middle.

The following exercise shows you how to clean a list of names with TRIM and check the result with LEN.

What you will practice in this exercise

You work on a customer list typed with stray spaces. You answer 5 questions, one formula per question:

  • Clean a last name (TRIM)
  • Clean a first name (TRIM)
  • Clean and combine last name + first name (TRIM + &)
  • Count the characters before cleaning (LEN)
  • Count the characters after cleaning (LEN + TRIM)

Practice with exercises

CLEAN — Remove extra spaces
🔒 Members only

CLEAN — Remove extra spaces
Strip stray spaces from a customer database with TRIM.

Subscribe →

Related articles

Excel exercises: practice online with instant correction

All the exercises in this series are based on real cases found on Excel forums. Each one answers a question that Excel users really ask.

Leave a Reply

Your email address will not be published. Required fields are marked *

TRIM Exercise: Remove Extra Spaces from Names

Reading time: 3 minutes

Extra spaces are invisible, but they break your formulas. “Smith ” with a space at the end is not equal to “Smith”, so a lookup fails and a count is wrong. TRIM removes the spaces at the start, at the end, and the double spaces in the middle.

The following exercise shows you how to clean a list of names with TRIM and check the result with LEN.

What you will practice in this exercise

You work on a customer list typed with stray spaces. You answer 5 questions, one formula per question:

  • Clean a last name (TRIM)
  • Clean a first name (TRIM)
  • Clean and combine last name + first name (TRIM + &)
  • Count the characters before cleaning (LEN)
  • Count the characters after cleaning (LEN + TRIM)

Practice with exercises

CLEAN — Remove extra spaces
🔒 Members only

CLEAN — Remove extra spaces
Strip stray spaces from a customer database with TRIM.

Subscribe →

Related articles

Excel exercises: practice online with instant correction

All the exercises in this series are based on real cases found on Excel forums. Each one answers a question that Excel users really ask.

Leave a Reply

Your email address will not be published. Required fields are marked *