+ Reply to Thread
Results 1 to 7 of 7

Split One-Cell String of Data by Comma, into Multiple Cells

  1. #1
    Registered User
    Join Date
    07-17-2020
    Location
    Winnipeg, Canada
    MS-Off Ver
    Office 365 Business
    Posts
    3

    Question Split One-Cell String of Data by Comma, into Multiple Cells

    Good day,

    Say I am importing a list of the number of doughnuts sold to my customers from an external database, and this list comes in the form of a string. I import it to one cell in Excel, let's say cell B1, and the list is "1,6,2,8,3,10,1004,12". Let's say this were today, then today I have a data string of 8 customers.

    Each purchase is separated by a comma, representing the next customer number for that day. The value stored between each comma would be the number of doughnuts that customer purchased.

    I want to populate individual cells according to the number of doughnuts sold to that customer number, given that this list will be variable in length AND variable in doughnuts sold to each customer, day by day. In other words, there is not going to necessarily be 8 customers tomorrow, I may have less and I may have more. Furthermore, I may have any whole-number of doughnuts sold to every customer tomorrow, but I want to use the same formula to populate my data cells.

    I've attached my hypothetical problem. How on earth could I go about doing this? I can't get the FIND, SEARCH, and MAX functions to help me. Any suggestions?
    Attached Files Attached Files
    Last edited by kintho; 07-17-2020 at 12:38 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: Split One-Cell String of Data by Comma, into Multiple Cells

    So you want to break each item up?

    Click on B1
    Go to Data tab
    Click on Text to Columns
    Check Delimited
    Click Next
    Make sure only Comma is checked
    Then Finish

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: Split One-Cell String of Data by Comma, into Multiple Cells

    Attached what it looks like. Then you can just copy the cells down to row 5
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-17-2020
    Location
    Winnipeg, Canada
    MS-Off Ver
    Office 365 Business
    Posts
    3

    Re: Split One-Cell String of Data by Comma, into Multiple Cells

    Is there an automated method to do this using cell formulas? Once again, I may sell 4000000 customer's worth of doughnuts, say. Therefore, I would not want to populate cells by hand every time I dump data to the worksheet. Thank you for the reply.

  5. #5
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: Split One-Cell String of Data by Comma, into Multiple Cells

    I could be wrong, but I would think formulas might be tricky depending on the number of entries you have.

    I would think you would need a power query for this.

    Can anybody else help out?

  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
    81,277

    Re: Split One-Cell String of Data by Comma, into Multiple Cells

    In B5 copied across:

    =TRIM(MID(SUBSTITUTE($B1,",",REPT(" ",100)),COLUMN(B1)*100-99,100))
    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.

  7. #7
    Registered User
    Join Date
    07-17-2020
    Location
    Winnipeg, Canada
    MS-Off Ver
    Office 365 Business
    Posts
    3

    Re: Split One-Cell String of Data by Comma, into Multiple Cells

    Thanks! Works a charm; 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. Replies: 5
    Last Post: 05-25-2020, 01:12 AM
  2. Split numbers in one cell deliminated by comma to separate cells
    By renix in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-27-2015, 02:07 PM
  3. [SOLVED] split a string of text in one cell into 2 new cells after occurance of second comma
    By syncguy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-06-2015, 12:50 AM
  4. Macro to split Cells delimter comma to multiple Rows.
    By pavan5183 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2013, 10:24 AM
  5. [SOLVED] Split the contents of the cell separated by comma into different cells
    By VivekBhise in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-30-2012, 06:50 AM
  6. Replies: 4
    Last Post: 09-04-2010, 03:37 AM
  7. Split cells and insert new row when cell contains a comma
    By nalfin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2009, 10:56 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