Removing excess spaces and nonprinting characters
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:
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:
- CLEAN removes all nonprinting characters from a string. These "garbage" characters often appear when you import certain types of data:
To remove all extra spaces and nonprinting characters, use these two functions:
= TRIM (CLEAN (<data>))
See also this tip in French: Suppression des espaces excédentaires et des caractères non imprimables.