+ Reply to Thread
Results 1 to 6 of 6

PROPER() Function Workaround where apostrphes occur

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Not here, it's rubbish!
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    66

    PROPER() Function Workaround where apostrphes occur

    Hi All,

    Anyone know of a workaround or alternative function when PROPER() fails with apostrophes?

    Simple example:

    Type in cell A1 the words martin's car
    Type in cell B1 =PROPER(A1)

    Result shows as Martin'S Car

    Obviously the S at the end of Martin should remain in lower case but PROPER() seems to fall over on this!

    Any advice greatly appreciated.

    Thanks
    Last edited by kyjae; 05-27-2013 at 11:55 AM. Reason: typo

  2. #2
    Forum Contributor
    Join Date
    09-11-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: PROPER() Function Workaround where apostrphes occur

    Hi,
    try this:
    =SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","excel")),"excel","'")

  3. #3
    Registered User
    Join Date
    10-04-2012
    Location
    Not here, it's rubbish!
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    66

    Re: PROPER() Function Workaround where apostrphes occur

    Thank you!

    Works perfectly. Would you take some time to explain how this formula works? Especially the "excel" bit as I've come across this before.

    Thank you.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: PROPER() Function Workaround where apostrphes occur

    What they did was replace ' with the word excel - they could have chosen anything, as long as it would have been unlikely to exist in any of your text. They then applied the PROPER(), and then replaced excel with ' to get things back to where they were
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    10-04-2012
    Location
    Not here, it's rubbish!
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    66

    Re: PROPER() Function Workaround where apostrphes occur

    Thank you so much for this.

    Another Excel snippet learned!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: PROPER() Function Workaround where apostrphes occur

    happy to help

+ 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