Summary
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.
Syntax
=TRIM(Cell)
Cell is the cell containing the text string you're trimming.
Examples
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".

Trouble with formulae? Lookups not going so well? The Wizard of Excel can help. Dan Harrison offers practical tips and examples, as well as Excel training and consulting.