When you copy or import text data into an Excel worksheet, the worksheet occasionally retains extra spaces next to the content you inserted. Normally, the TRIM() function can remove these unwanted spaces, whether they occur between words or at the beginning or end of a text string. However, in certain situations, TRIM() cannot perform the task.
On a computer, a space between words is not a blank area, but a character — and there is more than one type of space character. One space character that is often used on Web pages and that TRIM() does not remove is the non-breaking space.
If you have imported or copied data from web pages, you may not be able to remove the extra spaces using the TRIM() function if they are created by nonbreaking spaces.
Spaces are characters and each character is represented by its ASCII code value. ASCII stands for American Standard Code for Information Interchange — an international standard for text characters in computing environments that creates a single set of codes for 255 different characters and symbols used in computer programs.