TRIM function – remove leading and trailing spaces from cells

The TRIM function is useful and incredibly simple to use as invisible leading and/or trailing spaces in a cell can cause functions such as VLOOKUP to stop working.

In the following example the text in cell A2 has been entered with leading and trailing spaces.  The result in cell A2 shows apparent leading spaces, but the trailing spaces are effectively invisible.





By utilising the TRIM function, the referenced cell (A2) is ‘cleansed’ of all leading and trailing spaces in the result in cell A5.



Get more great content from Rousseau Associates

Start your project with us today

Call +44 (0)1757 269461

Discuss your requirements today