Remove unnecessary spaces from text in Excel
Removes excess spaces from strings


Remove unnecessary spaces from text.


The Excel TRIM function removes excess spaces from a text string except for one space between each word. For example, =TRIM(“Hello World”) [Three spaces] return “Hello World”.


=TRIM (text)


text – The text with unnecessary space

Return Value

The text without extra blanks

Key Notes

  • The TRIM function leaves only a single space between words. For example, =TRIM(“Hello Wo rld”) [three spaces and two spaces between three texts] return “Hello Wo rld” (only one space between three texts).
  • The TRIM function only removes the ASCII space character (32) – “ “ (Space) from a text.
  • The function also removes space
  • characters at the start or end of the text.

If a user want to remove spaces which are hidden in a cell, for this we will apply TRIM function in Excel.

Keep Reading Similar Functions:

Substitutes new text for old text in a text string in Excel


The SUBSTITUTE function replace the specific text in a text string that occurs in a specific location. i.e, =SUBSTITUTE(“Butter”,”t”,”l”,2) return “Butler”.

Read More »
Removes non-printable characters from a string in Excel


The CLEAN function delete the non-printable characters from 1 to 31 of the ANSI character set, the “garbage” characters that often appear after importing texts.

Read More »
To replace part of a text string in Excel


To replace part of a text string with new substrings based on given position in a selected text.

Read More »