Removing excess spaces and nonprinting characters

Excel 2016
Data imported into an Excel spreadsheet often contains extra spaces or strange (often unprintable) characters. There are two handy functions, TRIM and CLEAN, to cleanup such data:
Examples with spaces nad nonprinting characters in Excel 365

Excel offers two functions to help whip your data: TRIM and CLEAN.

  • TRIM removes all leading and trailing spaces and replaces internal strings of multiple spaces with a single space:
    TRIM function in Excel 365
  • CLEAN removes all nonprinting characters from a string. These "garbage" characters often appear when you import certain types of data:
    CLEAN function in Excel 365

To remove all extra spaces and nonprinting characters, use these two functions:

TRIM and CLEAN text example

= TRIM (CLEAN (<data>))

TRIM and CLEAN functions in Excel 365
TRIM and CLEAN functions 2 in Excel 365

See also this tip in French: Suppression des espaces excédentaires et des caractères non imprimables.

Please, disable AdBlock and reload the page to continue

Today, 30% of our visitors use Ad-Block to block ads.We understand your pain with ads, but without ads, we won't be able to provide you with free content soon. If you need our content for work or study, please support our efforts and disable AdBlock for our site. As you will see, we have a lot of helpful information to share.