+ Reply to Thread
Results 1 to 5 of 5

Removing apostrophies from a string

  1. #1
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Removing apostrophies from a string

    Hi!

    I have this rather beautiful formula that someone very kindly helped me compile a while back for cleaning a string which is copied in externally.

    =TRIM(IF(ISERROR(SEARCH("(",K34)),TRIM(LEFT(SUBSTITUTE(K34," ",REPT(" ",255)),LEN(SUBSTITUTE(K34," ",REPT(" ",255)))-255)),LEFT(SUBSTITUTE(K34,"(",REPT(" ",255)),255))))&"

    I've been trying to add in the function to also remove apostrophies from the string as well but to no avail so I am pleading for help! I'd like them to be deleted entirely, including the space and not substituted for anything.

    Big TIA!!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Removing apostrophies from a string

    =SUBSTITUTE(Your formula&"'" (that's double quote appost double quote),"'" (dq a dq), "" (dqdq))
    does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Removing apostrophies from a string

    Sorry, you've lost me at the dq bit... am I being thick?

  4. #4
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Removing apostrophies from a string

    He's just trying to make it clear what the text is. dq = double quote; a = appostrophe. You don't actually type the help in the parentheses.

  5. #5
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Removing apostrophies from a string

    haha I knew I was being thick! Thanks!!

+ 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