+ Reply to Thread
Results 1 to 17 of 17

Index, match, large ? results based on user input for week number

Hybrid View

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

    Re: Index, match, large ? results based on user input for week number

    Formula: copy to clipboard
    =LET(
    A,E7:R29, - input range
    B,E6:R6, - input range
    C,D7:D29, - input range
    D,D2, - input range
    E,SEQUENCE(ROWS(A)), - counts rows in A and returns an array: 1,2,3,4,etc
    F,XMATCH(D,B,0), - finds the correct column in A that matches D2
    G,INDEX(A,E,SEQUENCE(,F,MAX(1,F-4))), - chooses the matching column and (up to... depending on availability) 4 columns to the LEFT
    H,COLUMNS(G), - number of columns in G (could be anything up to 5)
    I,CHOOSECOLS(G,SEQUENCE(H-1)), - chooses all but the last column - could be 4 or fewer - (these are the ones you want to average)
    J,HSTACK(IFERROR(BYROW(I,LAMBDA(x,AVERAGE(x))),""),INDEX(G,,H),C), - calculates the average, row-by-row from I and joins it in a horizontal array with The last column of G (the data from the week in D2) and C (the titles)
    TAKE(SORT(FILTER(J,INDEX(J,,2)>0),2,-1),5)) - filters the non zero values from column 2 of the stacked array (J), sorts tehm by th second column in descending order and TAKEs only the first 5


    Maybe this will also help: refer to the file. I've moved the formula to B47. If you enter any of the letters defined at teh left in the formula at th epoint indicated, you can see exactly what the formula returns.

    I've also corrected a minor cosmetic error in J that I just spotted.
    Attached Images Attached Images
    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

+ 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] Multiple matches using Index Match - Prompt user to select which match to use as input
    By rudenstam in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-25-2021, 09:31 AM
  2. [SOLVED] INDEX MATCH? Multiple results from large data
    By joppert87 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-30-2020, 06:43 AM
  3. [SOLVED] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  4. User form with Index Match for 2 input boxes
    By Quasis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2015, 05:32 PM
  5. Replies: 0
    Last Post: 05-22-2014, 04:17 AM
  6. Need VBA for INDEX MATCH where user selects all variables from Input Box
    By rrcrbnsn07 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 02:43 PM
  7. Replies: 3
    Last Post: 07-16-2012, 09:00 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