+ Reply to Thread
Results 1 to 16 of 16

split and organize values from array to new array

  1. #1
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    split and organize values from array to new array

    Dear friends:

    I have an issue with Excel dynamic arrays.

    I start with a spilling array inherited in B6. I have no control over the size of this array. In my example attached, 2 rows, but it could be more.

    Each row represents a list of pairs label/value.
    Pairs separators are "/" for rows (label), "|" for columns (value).

    The pairs are not sorted. I have no control over how they are supplied to B6. Each row may be sorted differently, and possibly contains not common labels with other rows.

    My intention is to split all the pairs available in the initial array and provide as result a 2-rows spilling array as follow:

    - in a first row, we "merge" the common pairs (same label, same value), shared by all row of the initial array
    - in a second row, we isolate the specifics, and we keep the distinction between the distinct initial rows with a "***" separator.

    test.jpg

    What do you think about this?

    At first sight it looked not complex, but I ended up with a REDUCE within a REDUCE within a REDUCE ang got lost.

    Thanks for your input.
    Attached Files Attached Files
    Last edited by guillaume0314; 03-19-2024 at 12:33 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: split and organize values from array to new array

    I'm part way there... but am unable to go further because your ssample has only two rows. So I added one.

    The COMMON bits are done (yellow cell)

    I have done the specific bit for the comparison of rows 1 &2 of the array... and need to know what the ENTIRE set of results for the specific bit should look like.

    see file for work-in-progress.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: split and organize values from array to new array

    My proposal.

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

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: split and organize values from array to new array

    DJ... that's NOT the expected answer (the explanation is rather confused and the formula in B16 is irrelevant.). the expected answer is a spill array that looks like B10:B11

  5. #5
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: split and organize values from array to new array

    Tks Glenn, I saw that later on, trying, but so far with helper column.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,084

    Re: split and organize values from array to new array

    Another option, depending on how multiple rows should be handled
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,084

    Re: split and organize values from array to new array

    A shorter version of the above formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and a possible solution for more than 2 rows
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    Re: split and organize values from array to new array

    Thank you guys for looking into it.

    @Glenn, I updated the file accordingly, both input and expected output. Pls see the attached.

    @Fluff: the expected will be always a 2 row array, first row shared values, by all rows of input, second row specific values from each row of input.

    Thanks.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,084

    Re: split and organize values from array to new array

    the expected will be always a 2 row array, first row shared values, by all rows of input, second row specific values from each row of input.
    In that case you can use the formula in sheet1 of the workbook I posted yesterday

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: split and organize values from array to new array

    If Fluffs doesn't work out, I >>nearly<< have an slternative, bilut have to leave now for a "long lunch" with friends!!

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: split and organize values from array to new array

    In C17
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: split and organize values from array to new array

    Better formula.
    In C17
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 03-22-2024 at 05:15 AM.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: split and organize values from array to new array

    Finally... getting back to this, and just for completeness, my take on it. Try:

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

  14. #14
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    Re: split and organize values from array to new array

    Thank you guys it works great.

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,084

    Re: split and organize values from array to new array

    Glad to help & thanks for the feedback.

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: split and organize values from array to new array

    Ditto... You're welcome.

+ 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] split comma-separated values in a table, return spilling array
    By guillaume0314 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2023, 08:26 AM
  2. Replies: 4
    Last Post: 09-24-2022, 02:47 AM
  3. Replies: 6
    Last Post: 06-07-2022, 09:30 AM
  4. find array length got using split feature and valdate array elements
    By malathi1972 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2018, 04:51 AM
  5. Replies: 5
    Last Post: 02-22-2018, 01:47 AM
  6. [SOLVED] Split VBA array according to specific values
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-24-2017, 05:21 PM
  7. [SOLVED] Read last element of Split array and then discard it and resize the array.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 06:36 PM

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