Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kim Kim is offline
external usenet poster
 
Posts: 284
Default TRIM not trimming

I have thousands of rows of data that I have used the "Text to Columns"
function on so that they are now two columns instead of one (text in A,
numbers in B).

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.

What's wrong?


-- Thanks,
-Kim
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default TRIM not trimming

If you are using data from the web there might be non space html characters

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

is a macro that will clean these


here's how to install macros

http://www.mvps.org/dmcritchie/excel...la.htm#install



--
Regards,

Peo Sjoblom




"Kim" wrote in message
...
I have thousands of rows of data that I have used the "Text to Columns"
function on so that they are now two columns instead of one (text in A,
numbers in B).

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.

What's wrong?


-- Thanks,
-Kim



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default TRIM not trimming

If you are using data from the web there might be non space html characters

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

is a macro that will clean these


here's how to install macros

http://www.mvps.org/dmcritchie/excel...la.htm#install



--
Regards,

Peo Sjoblom




"Kim" wrote in message
...
I have thousands of rows of data that I have used the "Text to Columns"
function on so that they are now two columns instead of one (text in A,
numbers in B).

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.

What's wrong?


-- Thanks,
-Kim



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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)," "))

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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)," "))



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default TRIM not trimming

if there are still apperant spaces you can use code(mid(...)) to identify the
code to use in the char() formula

"Harlan Grove" wrote:

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)," "))


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default TRIM not trimming

Try using CLEAN() alongside TRIM().


On Aug 8, 6:22 pm, Kim wrote:
I have thousands of rows of data that I have used the "Text to Columns"
function on so that they are now two columns instead of one (text in A,
numbers in B).

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.

What's wrong?

-- Thanks,
-Kim



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default TRIM not trimming

It will not work for invisible html characters, just non printable
characters


--
Regards,

Peo Sjoblom



"ilia" wrote in message
oups.com...
Try using CLEAN() alongside TRIM().


On Aug 8, 6:22 pm, Kim wrote:
I have thousands of rows of data that I have used the "Text to Columns"
function on so that they are now two columns instead of one (text in A,
numbers in B).

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.

What's wrong?

-- Thanks,
-Kim





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trimming text scott Excel Worksheet Functions 4 December 16th 06 04:49 PM
Trimming Data Terry Bennett Excel Worksheet Functions 4 July 17th 06 02:57 PM
Trimming cell contents? Jeremy Turner Excel Worksheet Functions 4 June 19th 06 03:00 PM
IP Trimming Josh Excel Discussion (Misc queries) 1 June 16th 06 04:34 PM
Trimming a cell down to 256 Characters method373 Excel Discussion (Misc queries) 2 February 12th 06 02:59 PM


All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"