+ Reply to Thread
Results 1 to 13 of 13

Removing Spaces (?) from a cell

  1. #1
    Registered User
    Join Date
    03-17-2008
    Posts
    85

    Removing Spaces (?) from a cell

    Hi all

    Unfortunately the problem is not as simple as the title may sound

    Basically I have attached a example of what I mean

    I need to do a lookup on these cells but for some reason they all appear to have some kind of space characters in each cell which you can see if you double click on them. I have tried trims, text to columns, find replaces and none of these seem to work

    I have a huge list of these numbers / codes and they all have the weird space kind of characters at the end

    Can anyone give me a solution on how to remove them so my lookup will work ?

    Thanks very much !!

    Al

    EXAMPLE.xls
    Last edited by AK262007; 03-16-2009 at 08:13 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Removing Spaces (?) from a cell

    try selecting the range of items and go to Data|Text to Columns.

    Select Delimited and click Next

    Check Space and click Finish.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Removing Spaces (?) from a cell

    does =LEFT(A2;FIND(" ";a2;1)) helps?

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Removing Spaces (?) from a cell

    Hi,

    It seems you have 3 extra characters, you could try

    =LEFT(A2,LEN(A2)-3)
    Last edited by oldchippy; 03-16-2009 at 07:57 AM. Reason: Edit formula
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  5. #5
    Registered User
    Join Date
    03-17-2008
    Posts
    85

    Re: Removing Spaces (?) from a cell

    Thanks for the reply

    Unfortunately it seems that any number containing "E" (Example updated) then go into a strange format

    Any other idea's or any way of stopping this ?

    Thanks again

    Al

    EXAMPLE.xls

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Removing Spaces (?) from a cell

    You must change format because A cells are formated as text....

    Also, I make mistake in my formula, you must take -1:

    =LEFT(A2;FIND(" ";A2;1)-1)

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Removing Spaces (?) from a cell

    Quote Originally Posted by AK262007 View Post
    Thanks for the reply

    Unfortunately it seems that any number containing "E" (Example updated) then go into a strange format

    Any other idea's or any way of stopping this ?

    Thanks again

    Al

    Attachment 38964
    Repeat the same as I said before... but after selecting Space in the 2nd frame click Next and select Text from the top left column data format area and then click Finish...

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Removing Spaces (?) from a cell

    EDITED...

    you chould think about using SUBSTITUTE, ie:

    SUBSTITUTE(A2,CHAR(160),"")

    It's not clear from your post whether you're using these values as criteria in your VLOOKUP or they are the left most column of the range... so it's hard to provide further insight.

    EDIT: Nice tip NBVC.
    Last edited by DonkeyOte; 03-16-2009 at 08:05 AM.

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Removing Spaces (?) from a cell

    Formula works... It will remove all spaces at the end...

    It won't work if space is between words.. (then it will show only first word)

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Removing Spaces (?) from a cell

    Yep, my bad, I edited my post (belatedly) ... NBVC's approach to alter underlying values in first instance is the most robust I think.

  11. #11
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Removing Spaces (?) from a cell

    you chould think about using SUBSTITUTE
    You edited this?

  12. #12
    Registered User
    Join Date
    03-17-2008
    Posts
    85

    Re: Removing Spaces (?) from a cell

    Thanks to you all for the help on this one - all of them worked in the end and I have decided to use the solution from Zbor as this seems to be a nice tidy solution

    Thanks again !!!

  13. #13
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Removing Spaces (?) from a cell

    \o/ Did I earned one reputation point now

    (P.S. Don't forget -1 )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1