+ Reply to Thread
Results 1 to 14 of 14

remove spaces (special characters) after numbers

  1. #1
    Registered User
    Join Date
    11-04-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    remove spaces (special characters) after numbers

    Hello all.

    I have a table of data. But after the data, there are 2 spaces (or some kind of special characters) in the cell.
    I tried use TRIM function but it didn't work. I just want the whole table to be numbers so I can work with them.

    Please see the attachment.

    Thank you so much in advance for the help/solutions!
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: remove spaces (special characters) after numbers

    Try selecting all then find/replace
    find
    hold down the alt key and type 0160 on the NUMERIC KEYPAD
    replace with nothing
    replace all

    or(revised)
    =IF(LEFT(B2)=CHAR(160),"",SUBSTITUTE(B2,CHAR(160),"")+0)
    Last edited by martindwilson; 11-04-2012 at 07:19 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    05-22-2011
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: remove spaces (special characters) after numbers

    Try the attached, hope it helps.
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: remove spaces (special characters) after numbers

    where did you get char 202 from?

  5. #5
    Registered User
    Join Date
    05-22-2011
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: remove spaces (special characters) after numbers

    Looked for CHAR() before and after the string.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: remove spaces (special characters) after numbers

    code(right(c2)) returns 160
    char(202)is Ê

  7. #7
    Registered User
    Join Date
    05-22-2011
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: remove spaces (special characters) after numbers

    Does the formula work on your version of excel? I'm using the Mac version.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: remove spaces (special characters) after numbers

    =so code(right(c2) returns 202 for you i wonder why
    i'm not denying it works,just i couldn't see why, it just seems a tad over kill tho'
    mind you revised formula is
    =IF(LEFT(B2)=CHAR(160),"",SUBSTITUTE(B2,CHAR(160),"")+0)
    Attached Files Attached Files
    Last edited by martindwilson; 11-04-2012 at 07:15 PM.

  9. #9
    Registered User
    Join Date
    05-22-2011
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: remove spaces (special characters) after numbers

    Glad it does. Will inform in the future on the mac version.
    Did try the one suggested by you, did'nt have a numeric pad and suppose the same reason Char 160 did'nt work. Gave it a go

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: remove spaces (special characters) after numbers


  11. #11
    Registered User
    Join Date
    05-22-2011
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: remove spaces (special characters) after numbers

    Cheers.....

  12. #12
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: remove spaces (special characters) after numbers

    Hmm?

    Yet another reason for not buying a mac?
    What price vanity?

  13. #13
    Registered User
    Join Date
    11-04-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: remove spaces (special characters) after numbers

    Quote Originally Posted by martindwilson View Post
    =so code(right(c2) returns 202 for you i wonder why
    i'm not denying it works,just i couldn't see why, it just seems a tad over kill tho'
    mind you revised formula is
    =IF(LEFT(B2)=CHAR(160),"",SUBSTITUTE(B2,CHAR(160),"")+0)


    Thanks a bunch. You guys rock. This worked for me. I'm still a beginner but I'm learning a lot from reading the other topics already. Thanks again.

  14. #14
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: remove spaces (special characters) after numbers

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as "SOLVED".
    For the meantime I'll do it for you.

    How?
    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Note:
    You can also thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given.
    By doing so you can add to the reputation(s) of those who helped and shared their time in helping you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ 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