+ Reply to Thread
Results 1 to 8 of 8

INDEX, MATCH and Return an Array?? Or something like that...

  1. #1
    Registered User
    Join Date
    03-28-2023
    Location
    Cardiff, UK
    MS-Off Ver
    MS365 Version 2403
    Posts
    8

    Red face INDEX, MATCH and Return an Array?? Or something like that...

    Hi!

    I'm working with raw data which is split into 'trays' of 96 values (12 columns, 8 rows - See Input Tab). Each tray is separated by some text and blank cells.

    The end user will be able to use a dropdown column next to the raw data to mark each tray with a label ("Tray 1 Read 1", etc). The output tab will then be programmed to display trays in an order that I specify (Tray 1 read 1, tray 1 read 2, etc). The output order never changes but the input order can be completely random.

    I need a formula which is capable of searching for the label "Tray 1 read 1" (can be dynamic or cell ref) in the blue label column and displaying the relevant tray of 96 values as shown in the output tab, bearing in mind that the "tray 1 read 1" tray could be anywhere in the dataset. I was thinking using INDEX/MATCH could do it but I get confused very quickly with this sort of thing. This also must return any blank cells as blank cells and not 0. Nothing set in stone yet so open to any ideas.

    Thanks in advance

    Phoebe
    Attached Files Attached Files
    Last edited by keptbybees; 03-28-2023 at 11:06 AM.

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

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    Microtitre plates???


    =IFERROR(TAKE(FILTER(1/(1/Input!C4:N71),SCAN("",Input!O4:O71,LAMBDA(x,y,IF(y="",x,y)))=B12),8),"")
    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
    Registered User
    Join Date
    03-28-2023
    Location
    Cardiff, UK
    MS-Off Ver
    MS365 Version 2403
    Posts
    8

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    Bingo Thanks a lot Glenn, that works great. Let's hope I don't break it when I try to scale it up, ha!

    Phoebe

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

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    03-28-2023
    Location
    Cardiff, UK
    MS-Off Ver
    MS365 Version 2403
    Posts
    8

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    [Hi Glenn!

    There's one more thing I want to add... a cell next to the output table that tells the user what the tray in question "tray 1 read 1" was originally labelled in the data (on the left where it says Test tray: 1 etc)... if that makes sense?

    Cheers,
    P]

    Actually, scratch that... I've hit an issue with the original formula. Sometimes there are blank cells in the raw data or values ending in * which need to be processed slightly differently. I am performing a calculation on the data in the output table, based on whether F8 (or any cell in that table) is blank, contains a * or contains a numerical value. =IF(ISBLANK(F8),"Missing",(IF(ISNUMBER(SEARCH("~*",F8)),"MARKED",(((top secret maths calculation/irrelevant)))). However when I populate the output table using the method you kindly provided before, this formula doesn't behave the way I need it to. Is there another way to identify blank cells and *'s in the output table as per the previous solution. Or can the previous solution be modified to allow for this?

    Many thanks

    Phoebe
    Last edited by keptbybees; 03-30-2023 at 07:09 AM.

  6. #6
    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,055

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    I do not understand. Post a sample file showing the input you have and the output you want to see. Use the original sample file??

  7. #7
    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,055

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    A guess (if not I REALLY do need to SEE what you mean).

    =LET(a,IFERROR(TAKE(FILTER(Input!C4:N71,SCAN("",Input!O4:O71,LAMBDA(x,y,IF(y="",x,y)))=B12),8),""),IF(a=0,"Missing",a))
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-28-2023
    Location
    Cardiff, UK
    MS-Off Ver
    MS365 Version 2403
    Posts
    8

    Re: INDEX, MATCH and Return an Array?? Or something like that...

    Hi Glenn, not sure if my original reply sent (I'm sure I was waffling anyway) but I ended up inserting the original formula you wrote for me [=IFERROR(TAKE(FILTER(1/(1/Input!C4:N71),SCAN("",Input!O4:O71,LAMBDA(x,y,IF(y="",x,y)))=B12),8),""))] into this (some cell refs have changed) and it works beautifully:
    =SWITCH(IFERROR(ERROR.TYPE(TAKE(FILTER(1/(1/Input!$C$6:$N$147),SCAN("",Input!$O$6:$O$147,LAMBDA(x,y,IF(y="",x,y)))=C4),8)), "TEST"), 2, "", 3, "*", TAKE(FILTER(1/(1/Input!$C$6:$N$147),SCAN("",Input!$O$6:$O$147,LAMBDA(x,y,IF(y="",x,y)))=C4),8))

    I am really curious as to how the part you wrote for me works though. Is there any way you could try to explain for me? Or point me in the direction of what I can read up on to try and decode it myself? Many thanks

+ 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. Index/Match? to return a filtered array
    By keegan4123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-31-2022, 12:23 PM
  2. [SOLVED] Index match array return all matching values
    By Lameimpala in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-02-2019, 12:44 PM
  3. VBA_Cell to Return Value of INDEX and MATCH Array formula
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2017, 02:20 AM
  4. [SOLVED] Index/Match to Return 1D array to be used in a sumproduct
    By david0985 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2014, 04:41 PM
  5. Use Index/Match Function to Return Values from an Array
    By 00pumpkin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2013, 02:22 PM
  6. Match/Index array in VBA to return cell address
    By djhsickboy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2011, 02:18 AM
  7. Replies: 2
    Last Post: 02-27-2010, 11:17 AM

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