+ Reply to Thread
Results 1 to 20 of 20

Splitting Row by values into multiple rows

  1. #1
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Splitting Row by values into multiple rows

    Cross-posted at https://www.mrexcel.com/board/thread...-rows.1228217/

    Hello,

    I'm trying to split these rows into multiple rows, maintaining the row headings. The data looks like this:

    Please Login or Register  to view this content.
    I'm trying to group by values and splitting them into multiple rows, keeping the header:
    Please Login or Register  to view this content.
    I've attached a sample sheet.

    I have tried using MakeArray, but I'm unable to grab that keep that row header... just the values after.

    SVT
    Attached Files Attached Files
    Last edited by 6StringJazzer; 01-27-2023 at 03:57 PM. Reason: added xpost link

  2. #2
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Splitting Row by values into multiple rows

    Hi @subvtech
    I can’t foresee how to do it using only formula
    Have you thought about using VBA?
    that would be very simple
    Barriers are there for those who don't want to dream

  3. #3
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    Hi,
    can you please attach the formula you have crafted with MAKEARRAY?

    thanks.

  4. #4
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by vichopalacios View Post
    Hi subvtech
    I can’t foresee how to do it using only formula
    Have you thought about using VBA?
    that would be very simple

    No, I haven't thought about VBA.
    Last edited by subvtech; 01-27-2023 at 01:34 PM.

  5. #5
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by Limor_OP View Post
    Hi,
    can you please attach the formula you have crafted with MAKEARRAY?

    thanks.
    Attached is as far as I made it. It only gathers values from a specific column. Took me for ever get that far. Find pieces here and there on the webs.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    I though you were looking for horizontal solution that runs for each line , and not for each column....

  7. #7
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by Limor_OP View Post
    I though you were looking for horizontal solution that runs for each line , and not for each column....
    You are correct. I was working with a column initially and tried to apply it to horizontal data. This is as far as I had gotten. I am in fact looking to split rows of data into multiple rows grouped by numbers. I can only group the numbers in a column

  8. #8
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    Hi,
    this is the best I could find for now, with 3 different formulae for A, B and C:

    A9 = GROUP-1;
    A10 and down:
    Please Login or Register  to view this content.
    B9 and down:
    Please Login or Register  to view this content.
    C9 and drag across:

    =IF(COUNTIF($B9:B9,$B9)<SUM(--(INDEX($B$2:$F$5,MATCH($A9,$A$2:$A$5,0),COLUMN($A$1:$E$1))=$B9)),$B9,"")
    Attached Files Attached Files
    Last edited by Limor_OP; 01-27-2023 at 03:40 PM.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Splitting Row by values into multiple rows

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    I added the link to post #1 since you are new.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  10. #10
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by Limor_OP View Post
    Hi,
    this is the best I could find for now, with 3 different formulae for A, B and C:

    A9 = GROUP-1;
    A10 and down:
    Please Login or Register  to view this content.
    B9 and down:
    Please Login or Register  to view this content.
    C9 and drag across:

    =IF(COUNTIF($B9:B9,$B9)<SUM(--(INDEX($B$2:$F$5,MATCH($A9,$A$2:$A$5,0),COLUMN($A$1:$E$1))=$B9)),$B9,"")
    Interesting. I am trying it out now.

  11. #11
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Rule Learned.

    Thank you

  12. #12
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by Limor_OP View Post
    Hi,
    this is the best I could find for now, with 3 different formulae for A, B and C:

    A9 = GROUP-1;
    A10 and down:
    Please Login or Register  to view this content.
    B9 and down:
    Please Login or Register  to view this content.
    C9 and drag across:

    =IF(COUNTIF($B9:B9,$B9)<SUM(--(INDEX($B$2:$F$5,MATCH($A9,$A$2:$A$5,0),COLUMN($A$1:$E$1))=$B9)),$B9,"")
    This is great.. However, it doesn't like letters and for some reason there appears to be a line of #REF! between the breaks. I really don't mind as long as it is working. I've attached my results.
    This give me hope that there is light at the end of the road
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    Hi,
    here is your file with my formulae applied:

    A16:
    Please Login or Register  to view this content.
    B15:

    Please Login or Register  to view this content.
    C15 and across:

    =LET(c,INDEX($B$2:$M$11,MATCH($A15,$A$2:$A$11,0),COLUMN($A$1:$L$1)),IF(COUNTIF($B15:B15,$B15)<SUM(--(c=$B15)*--(c<>"")),$B15,""))
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by subvtech View Post
    This is great.. However, it doesn't like letters and for some reason there appears to be a line of #REF! ...........
    Hey
    did you check my latest post?
    I have applied the formulae on your sample, and made some changes since you have "0" also in your real data which I didn't take into account in the initial sample, and since blank cells are also counted as "o"s so I had to adjust that....

    Let me know your thoughts.

  15. #15
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    Hi,
    here is the new version (next time please post a sample similar to your real data as the formulae might differ if you add for example alphanumeric characters)

    In addition - you had a few cells that just looked empty but they had a hidden character filled in, which added another empty line to the results, so I deleted the content of these cells.
    Attached Files Attached Files
    Last edited by Limor_OP; 01-27-2023 at 07:12 PM.

  16. #16
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by Limor_OP View Post
    Hi,
    here is the new version (next time please post a sample similar to your real data as the formulae might differ if you add for example alphanumeric characters)

    In addition - you had a few cells that just looked empty but they had a hidden character filled in, which added another empty line to the results, so I deleted the content of these cells.
    This is working as intended. Much appreciated.

    That first row, COLUMN($A$1:$T$1), is supposed to be one cell sorted then the range below it correct? Looks that way.

  17. #17
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Splitting Row by values into multiple rows

    Hi
    you're welcome.

    the first row in the formula is part of the INDEX function.
    It finds the range for each header accordingly (before narrowed down by UNIQUE)
    you can run this segment independently and see what you will get...
    Thanks for the feedback : )

    =IFERROR(INDEX(UNIQUE(TOCOL(FILTER(UNIQUE(INDEX($B$2:$U$7,MATCH(A9,$A$2:$A$7,0),COLUMN($A$1:$T$1)))),UNIQUE((INDEX($B$2:$U$7,MATCH(A9,$A$2:$A$7,0),COLUMN($A$1:$T$1))))<>""))),COUNTIF($A$9:A9,A9)),"")
    Last edited by Limor_OP; 01-28-2023 at 09:45 AM.

  18. #18
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by subvtech View Post
    This is working as intended. Much appreciated.

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking addreputationiconsmall.jpg below their name.

  19. #19
    Registered User
    Join Date
    01-27-2023
    Location
    New York
    MS-Off Ver
    365
    Posts
    9

    Re: Splitting Row by values into multiple rows

    Quote Originally Posted by 6StringJazzer View Post
    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking Attachment 815395 below their name.
    Trying to mark thread as solved.. can't find the button

  20. #20
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Splitting Row by values into multiple rows

    Do you see Thread Tools above your first post?

    solved.jpg

+ 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] Splitting multiple cell values into rows (Unpivot)
    By daithy in forum Excel General
    Replies: 13
    Last Post: 01-16-2023, 03:46 PM
  2. Replies: 14
    Last Post: 08-20-2014, 05:46 AM
  3. [SOLVED] Splitting Cell in multiple rows
    By JonathanReard in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2014, 11:04 AM
  4. Splitting Cells with multiple values into separate rows
    By dracon6 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2014, 12:53 AM
  5. Splitting rows with multiple columns into seperate rows for time points.
    By mbracha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-16-2013, 10:06 AM
  6. [SOLVED] Splitting 1 row into multiple rows
    By iusckeeper in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-31-2012, 10:22 PM
  7. Replies: 7
    Last Post: 08-16-2010, 11:48 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