View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default TRIM not trimming

Kim wrote...
....
However, there are leading and trailing spaces in both columns, and
when I used the =TRIM function to remove them, it doesn't work. Even
when I use TRIM in column D, then copy that value into Notepad, I
can still see the spaces.

....

I'd guess your cell data comes from an HTML source, and it contains
nonbreaking spaces (decimal character code 160). You need to replace
them with ASCII/breaking spaces, then apply TRIM.

=TRIM(SUBSTITUTE(x,CHAR(160)," "))