+ Reply to Thread
Results 1 to 4 of 4

Trim function for special characters

  1. #1
    Registered User
    Join Date
    06-28-2007
    Posts
    69

    Trim function for special characters

    I have a dataset with several thousand lines and I need to remove any characters after the last letter in the string. I have tried the "Trim" function and by using "-left(a2,find(" ",a2)-1)".
    Neither of the formulas work which lead me to believe that there are no "spaces".

    Please see the attached worksheet. Any help would be greatly appreciated.

    Mike
    Attached Files Attached Files
    Last edited by mpquin; 04-13-2010 at 10:05 AM. Reason: solved

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

    Re: Trim function

    Correct.. Space is only on last position...

    Therefore use:

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

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

    Re: Trim function

    Try formula:

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

    copied down.
    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.

  4. #4
    Registered User
    Join Date
    06-28-2007
    Posts
    69

    Re: Trim function

    Thanks guys...saved me again!

+ 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