This is an oft forgotten function. Quite simply, it gets rid of unwanted spaces. It does so in the following ways.

  • All leading spaces that appear at the start of the cell being trimmed are removed
  • All trailing spaces at the end of the cell being trimmed are removed
  • Any groups of spaces appearing midway through the string are reduced to a single space.



Cell is the cell containing the text string you're trimming.


Below are some examples of the value of cell, and the result of the TRIM function.

"   Chicken" becomes "Chicken"

"Chicken   " becomes "Chicken"

"   Chicken   Tikka   Masala   " becomes "Chicken Tikka Masala".

This entry was posted in Formulae explained and tagged , . Bookmark the permalink.