+ Reply to Thread
Results 1 to 3 of 3

Remove extra comma in a text fild

  1. #1
    Registered User
    Join Date
    12-26-2006
    Posts
    54

    Remove extra comma in a text fild

    My sheet's colunm B has text with some extra comma's. I want to know how to remove them?

    What I have:
    Please Login or Register  to view this content.
    What result I want:
    Please Login or Register  to view this content.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Remove extra comma in a text fild

    Hi,

    This might do the job for you.

    =SUBSTITUTE(TRIM(SUBSTITUTE(B1,","," "))," ",",")
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

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

    Re: Remove extra comma in a text fild

    in col c put
    =TRIM(SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(B1," ","^"),","," "))," ",","),"^"," ")) fill down
    then copy paste back special values
    the above formula retains existing spaces
    eg
    ,,,,,,Apple,,Orange box ,,, becomes
    Apple,Orange box
    "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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Remove extra space from the end of the cell contain text
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2013, 09:55 AM
  2. Find and remove all text to the left of last comma (including comma) in a cell
    By Excelrookie_1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-05-2013, 08:47 AM
  3. Replies: 8
    Last Post: 08-27-2012, 04:37 PM
  4. Remove Extra Zeros from Text
    By skaswani in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-22-2010, 08:55 PM
  5. Remove all text after 1st comma and Remove the -,NE and spacing
    By Tan Bee Hock in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2008, 06:28 AM

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