+ Reply to Thread
Results 1 to 3 of 3

Formula or macros to remove double spacing and special character

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    London,England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Formula or macros to remove double spacing and special character

    Hi,

    I need help with a quick way to remove double spacing, extra spaces at beginning and end of text and also replace any special character with a space.

    I have attached an example of bad data in column A and Column B shows how i would like it.

    Is there a Formula or macros to help cleansed the data quickly?

    Many thanks guys,

    Mike
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,150

    Re: Formula or macros to remove double spacing and special character

    =SUBSTITUTE(TRIM(CLEAN(A2)),"'"," ")

    will address the "obvious" issues in your examples. You can, if needed, nest the SUBSTITUTE function.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    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: Formula or macros to remove double spacing and special character

    The function TRIM() will remove all extra spaces from a string as well as leading and trailing spaces.
    The apostrophe in "Jim O'hara" is normally seen as legitimate, however the space in "Neil O' reily" isn't.

    Try in B2
    Please Login or Register  to view this content.
    Drag/Fill Down
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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