+ Reply to Thread
Results 1 to 11 of 11

Flatten a Random Matrix

  1. #1
    Registered User
    Join Date
    11-30-2022
    Location
    Denver, CO
    MS-Off Ver
    2023
    Posts
    4

    Flatten a Random Matrix

    Hey I am trying to dynamically flatten the attached matrix to return two columns (A6:B17). The first being the associated letter, and the second being a combination of the numbers and columns. I think this can be down with a combination of lookups, tocol, and unqiue; but I can't quite get it to work. Thanks so much!
    Attached Files Attached Files

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,427

    Re: Flatten a Random Matrix

    You are talking in your post about TOCOL.
    If your Excel recognizes TOCOL you are using Office 365, please update your profile.

    Excel 365 solution:

    One way:

    Please try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 02-07-2024 at 09:56 PM.

  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: Flatten a Random Matrix

    Another way.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by DJunqueira; 02-08-2024 at 12:53 AM.

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,427

    Re: Flatten a Random Matrix

    Nice formula @DJunqueira, but your formula returns only the second column, but not the first column with a's, b's and c's.

  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: Flatten a Random Matrix

    Tks Hans, , I didn't notice that it should bring the a,b,c..

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

    Re: Flatten a Random Matrix

    Tks again Hans.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by DJunqueira; 02-08-2024 at 01:01 AM.

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,427

    Re: Flatten a Random Matrix

    Nice formula DJunqueira

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

    Re: Flatten a Random Matrix

    Tks Hans, your is too as usual.

  9. #9
    Registered User
    Join Date
    11-30-2022
    Location
    Denver, CO
    MS-Off Ver
    2023
    Posts
    4

    Smile Re: Flatten a Random Matrix

    Thanks so much Hans and DJ, impressive!
    Last edited by andy521; 02-08-2024 at 11:59 AM.

  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,053

    Re: Flatten a Random Matrix

    Both excellent! One tweak (in case cols B, C & D can be blank):

    =TEXTSPLIT(TEXTJOIN(";",1,BYROW(A2:D4,LAMBDA(x,IFERROR(TEXTJOIN(";",1,TOROW(TAKE(x,,1)&""&(TOROW(DROP(x,,1),1)&TOCOL(E1:F1,1)),1)),"")))),"",";",1)

    It's always nice to see these approaches to help learning.
    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

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

    Re: Flatten a Random Matrix

    Nice addition Glenn!

    =TEXTSPLIT(TEXTJOIN(";",1,BYROW(A2:D4,LAMBDA(x,IFERROR(TEXTJOIN(";",1,TOROW(TAKE(x,,1)&"|"&(TOROW(DROP(x,,1),1)&TOCOL(E1:F1,1)),1)),"")))),"|",";",1)

    I would just point the 2 missing signs '|' that you may have some problem with it disappearing as I did when writing the formula in the forum message. First I tried with \ that is the sign Excel uses in my locale to indicate change column.

+ 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] Matrix of IFs & random numbers
    By bittubadri in forum Excel General
    Replies: 3
    Last Post: 03-24-2020, 12:25 PM
  2. [SOLVED] Generate random lines 3 numbers limit per line and 3 per column The matrix below 5x5
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-24-2016, 07:18 PM
  3. Flatten/ de-pivot
    By ccb81 in forum Excel General
    Replies: 1
    Last Post: 08-18-2014, 04:45 PM
  4. Flatten a Crosstable
    By jiggaboi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2013, 03:25 PM
  5. How to 'flatten' a set of values
    By JosVL in forum Excel General
    Replies: 3
    Last Post: 12-04-2009, 04:50 AM
  6. [SOLVED] How to setup a random matrix in Excel without repeating numbers?
    By Kat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2006, 10:35 PM
  7. [SOLVED] flatten pivotTable
    By [email protected] in forum Excel General
    Replies: 5
    Last Post: 01-14-2005, 06:06 PM

Tags for this Thread

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