ExcelFunctions.net Logo

The Excel TRIM Function

Home » Excel-Built-In-Functions » Excel-Trim-Function

Search this site:
Custom Search

Related Function :

Basic Description

The Excel TRIM function takes a supplied text string and removes any spaces, except for single spaces between words or characters.

The format of the function is:

TRIM( text )

where the argument, text, can be supplied to the function directly, or can be a reference to a cell containing text.

Note that the Trim function differs from the Clean Function in that the Trim function removes additional spaces (represented by the ASCII numeric code 32), while the Clean Function removes characters with the ASCII numerics codes 0 to 31.


Example

The example below shows the Trim function used on four different text strings.

Excel Trim Function Results

In all four of the above cases, the result is the string

"trim text"

- with no spaces at the start or end and just one space in the middle.






Valid XHTML 1.0 Transitional

Disclaimer Privacy Policy

Copyright © 2008-2010 ExcelFunctions.net