+ Reply to Thread
Results 1 to 6 of 6

Split Column at comma

Hybrid View

  1. #1
    Registered User
    Join Date
    02-14-2008
    Posts
    8

    Split Column at comma

    Would there be a formula for splitting a line like the following into separate cells:
    rear handle assy, replaces 20870-65100, 20870-65101, 20870-65102
    Below is what I want it to look like: (COL indicates column separators, for example only, not to be used)
    Instead of:
    (COL1) rear handle assy, replaces, 20870-65100, 20870-65101, 20870-65102
    Should be:
    (COL1) rear handle assy (COL2) replaces 20870-65100, 20870-65101, 20870-65102
    Basically, the formula could define the separating point by splitting "replaces" and everything after that into a new column. PLEASE NOTE that the comma after "assy" has been removed in the finished example...that's how I want it, if possible. I don't want that first comma there after the line has been split.

    Thanks in advance, I appreciate any help very much, as I'm an Excel novice.
    Last edited by KarambaStar; 04-10-2008 at 09:10 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526
    Quote Originally Posted by KarambaStar
    Would there be a formula for splitting a line like the following into separate cells:


    Below is what I want it to look like: (COL indicates column separators, for example only, not to be used)
    Instead of:


    Should be:


    Basically, the formula could define the separating point by splitting "replaces" and everything after that into a new column. PLEASE NOTE that the comma after "assy" has been removed in the finished example...that's how I want it, if possible. I don't want that first comma there after the line has been split.

    Thanks in advance, I appreciate any help very much, as I'm an Excel novice.
    Hi,
    Try text to columns,
    Select the cell, then goto data,text to columns, there you can select where you want the text to be split,

  3. #3
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    Try this:

    Go to Edit and there choose "Find": "replaces"

    Replace (this is the find/replace from the edit tab) "replaces" by *replaces
    You should now have this in the cell.

    rear handle assy, *replaces 20870-65100, 20870-65101, 20870-65102
    Select the cells you want, go to "data", "text to columns" and choose "delimited" by "other" and choose symbol *

    You can use the find/replace option again to get rid of the ending comma in the first column.
    Last edited by Portuga; 04-10-2008 at 09:27 PM.
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

  4. #4
    Registered User
    Join Date
    02-14-2008
    Posts
    8
    Thanks so much for the replies! I will try those tomorrow (as it's time to catch some shuteye) and post back!
    Thanks again!

  5. #5
    Registered User
    Join Date
    02-14-2008
    Posts
    8
    Well thanks to the above suggestions, I got most of that problem resolved. But I still have a little problem with removing the comma, is there any way to automatically remove the comma from the end of the line? I can't tell it to find/replace all the commas, because some of them I need. Example:

    pipe, curved,
    In the above example, all I need to remove is the comma on the end, after "curved". The other comma cannot be deleted. It's pretty time consuming to do them all by hand (almost 3,000 rows) so I was hoping for some solution that would ignore the first comma and remove the second comma. They don't all have 2 commas, some are like this:

    protector,
    If it's not possible to fix the first example (that has two commas), would there be a formula to fix the second example? (only needs the ending comma removed). It still can't be a formula that deletes all the commas.

    thanks a lot

  6. #6
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    Why dont you try replace:

    ", replaces"

    with

    "*replaces"

    and then use the text to columns as before.

    (if there are more that one space between the comma and "replaces", use the "Trim" function to your data and then use the procedure above)
    Last edited by Portuga; 04-11-2008 at 12:48 PM.

+ 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