Thursday, September 10, 2009

To How to Use Excel's TRIM Function

http://www.ehow.com/how_2105841_use-excels-trim-function.html

Excel's TRIM function removes all spaces from the specified text except a single space between words. It is frequently used on text that has irregular spacing. TRIM deletes the ASCII space, which has decimal value of 32. It does not delete the Unicode non-breaking space, with decimal value of 160, which is represented by " " in web pages.

* Email
* Print Article
*
* Add to Favorites
* Flag Article
* Bookmark and Share

Difficulty: Challenging
Instructions

1.
Step 1

Learn the syntax for TRIM. It is: TRIM(spaced_text) where spaced_text is the text from which spaces are to be removed.
2.
Step 2

Use TRIM to remove extra spaces from formulas so they work correctly. All leading and trailing blanks will be removed. Multiple spaces between words will be replaced with a single space.
3.
Step 3

Combine TRIM with CLEAN and SUBSTITUTE to remove all spaces and nonprinting characters from text. These include Unicode characters 0 to 31 inclusive, 127, 129, 141, 143, 144 and 157, which can cause undesired results when filtering, searching and sorting. Bear in mind that the first 127 characters in Unicode are the same as the seven-bit ASCII character set.
4.
Step 4

Run SUBSTITUTE first to replace higher value Unicode characters with ASCII characters that CLEAN and TRIM will work with. Run CLEAN next to remove the non-printing characters and finally, run TRIM to remove the spaces.
5.
Step 5

Look at an example of the use of TRIM: TRIM(" sample text ") = (sample text). Note that the leading and trailing blanks were removed as were all but one of the blanks between "sample" and "text."

No comments:

Post a Comment