+ Reply to Thread
Results 1 to 11 of 11

Formula to separate Values by Commas in different columns

  1. #1
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Formula to separate Values by Commas in different columns

    Hello All,
    I am using Excel 2010 and have the problem shown in the attached sample data.

    The attached sheet shows a single row but the actual data is several thousand rows

    'Before' Sheet shows values in Col C. There are total 12 text values separated by commas in the column but for explanation I have numbered them.

    After Sheet shows the result desired through a formula if possible. If not then a VBA

    TIA
    Rashid Khan
    Attached Files Attached Files
    Last edited by prkhan56; 12-19-2015 at 01:34 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,908

    Re: Formula to separate Values by Commas in different columns

    What is the logic for the split?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Formula to separate Values by Commas in different columns

    To upload in our system

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,908

    Re: Formula to separate Values by Commas in different columns

    No, I asked what is the logic for the SPLIT? How do I know what has to go in each column? What should go in A? Is it always the first 4 numbers? When and how do I determine where I need just one number from the string? You need to explain very clearly how you arrive at your expected outcome.

  5. #5
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Formula to separate Values by Commas in different columns

    I will explain here in more detail.

    The data is text data separated by commas.
    First four text values, which I have written as numbers for explanation purpose only, will go in column A.
    The complete 12 text values will remain in Col B.
    The 6th value should go in Col C
    and the 5th value in Col D

    Hope this is clear now

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,908

    Re: Formula to separate Values by Commas in different columns

    Will there always be 12 values?

  7. #7
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Formula to separate Values by Commas in different columns

    Yes it will be text values separated by commas

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to separate Values by Commas in different columns

    Enter this formula in A1 on your "After" sheet and pull formula to the right

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to separate Values by Commas in different columns

    Actually, I think that the above formula may not work well if instead of 1,2,3 you will have something else

    Give this one a try instead.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Formula to separate Values by Commas in different columns

    Okay, not sure if this would work for you.

    1. I just copied the data from C to B (seemed a heck of a lot easier)
    2. In A1 copied down
    =LEFT(B1, FIND("^",SUBSTITUTE(B1,",","^",4))-1)
    3. In C1 copied down
    =MID(B1, FIND("^", SUBSTITUTE(B1, ",", "^",5))+1, FIND("^", SUBSTITUTE(B1, ",", "^",6))-FIND("^", SUBSTITUTE(B1, ",", "^",5))-1)
    4. In D1 copied down
    =MID(B1, FIND("^", SUBSTITUTE(B1, ",", "^",4))+1, FIND("^", SUBSTITUTE(B1, ",", "^",5))-FIND("^", SUBSTITUTE(B1, ",", "^",4))-1)
    Attached Files Attached Files
    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

  11. #11
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Formula to separate Values by Commas in different columns

    Great solution from great masters.

    All working fine
    Thanks to everyone for their time and help.
    Post marked Solved

+ 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. [SOLVED] Excel2010 IF Formula to return value based on a separate date and two separate text values
    By jakecutler in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2015, 03:24 AM
  2. [SOLVED] Hi, I need the formula to separate the numbers with commas to other columns as shows below
    By binoos123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-21-2013, 05:36 AM
  3. [SOLVED] 2 separate columns with numbers separated by commas and single numbers not, need sum
    By Slothbob in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-22-2013, 04:33 PM
  4. [SOLVED] Values separated by Commas - want in separate columns, cells from original cell
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-03-2012, 02:50 PM
  5. Replies: 4
    Last Post: 08-22-2012, 07:22 PM
  6. Formula to separate cell values in a column with commas
    By PuffyGrl82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2011, 10:15 PM
  7. Separate string by commas
    By antoni in forum Excel General
    Replies: 2
    Last Post: 10-03-2009, 01:51 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