+ Reply to Thread
Results 1 to 17 of 17

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

  1. #1
    Registered User
    Join Date
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    Hello,

    Hopefully it is an easy one for someone/anyone who is willing to help!

    Attached is the clean xls file

    Firstly, I would like to be able to add additional weeks into the table capturing the data so it can be a useful tool moving forward without too much manual editing as time marches on.. not entirely sure how to go about that whilst maintaining the integrity of the "Top 5 Failures" table below

    The coding part...

    The user would enter the week number into Cell D2 for which they are interested in

    That would then populate the "Top 5 failures table" with the highest 5 values from that week (D2) but from the corresponding column in Row 6 and the dataset from rows 7:29... (i guess using the "large" function?), the "defect description" which is taken from corresponding cell from the range D7:F29

    And if that was not complicated enough

    Cells B39:43 would show the 4 week average too

    I can get the various bits to to work as standalone bits but can not get it to be dynamic on User input... which is a must really, as well as being able to add future weeks into the table

    I had hoped

    =INDEX($D$7:$F$29, MATCH(LARGE($K$7:$K$29,A39),$K$7:$K$29,0))

    in F39 would do it but no joy...

    Please do say if anything is unclear and I will try to elaborate further

    Any and all help will be gratefully received!

    Happy New Year!
    Attached Files Attached Files
    Last edited by BA_Abacus; 01-10-2023 at 10:38 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, large ? results based on user input for week number

    1. Get RID of all the merged cells in the results area and in the top part of column D.

    2. Delete everything in the area set aside for results.

    3. use this in D39.

    =LET(A,E7:R29,B,E6:R6,C,HSTACK(FILTER(A,B=D2),D7:D29),TAKE(SORT(FILTER(C,INDEX(C,,1)<>0),,-1),5))

    the results spill across and down. Format D39 downwards as %
    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
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    Ah, Thanks that sorts out one aspect! Cheers. I did wonder whether it was the merged cells which was causing the issue

    Any idea on the other aspects?

    I see that you have made "B" reference the week numbers. Would this continue to work if future weeks were added in? or should this data be incorporated into a dashboard from separate tabs in your opinion?
    Last edited by BA_Abacus; 01-10-2023 at 11:10 AM.

  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, large ? results based on user input for week number

    By "other aspects" do you mean:

    Cells B39:43 would show the 4 week average too

    if so... with week 2 selected... which four weeks?

    And for that matter, the 4 week average of WHAT?

  5. #5
    Registered User
    Join Date
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    Sorry, I will try to explain more fully.

    I have added a bit more data to the sheet you made changes to

    so in this example, the user has chosen week 2 in cell D2

    That then displays the top 5 ranked failures for that week.

    In our example it is

    "Test data Genuine Failure 3"

    with the last 4 weeks' entries for that entry being weeks 2, 52, 51 & 50 inclusive, where the actual values are 6%, 5%, 0.20% & 1.30% respectively


    If it was a standalone formula something like

    =sum(F10:I10)/4

    should give the average to populate B39


    Hopefully that explains a bit better
    Attached Files Attached Files

  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, large ? results based on user input for week number

    Perfect! Back soon (I hope)...

  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, large ? results based on user input for week number

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


    see file...
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    WOW! What the....?!

    I had no idea it would be so complicated!!

    It doesnt seem to work if I enter "3" into D2

    Thank so much for the time and effort so far!

  9. #9
    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, large ? results based on user input for week number

    Quote Originally Posted by BA_Abacus View Post
    It doesnt seem to work if I enter "3" into D2
    Oh Pooh to that!!!

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

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

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


    It could (probably) be made shorter, but my "pre-fab" approach makes it easier to troublesheet (IMHO). The bit in red was at fault. It used to read 5.

    Putting nice round numbers into the sample enabled me to track the problem down reasonably quickly.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    Absolute legend!

    The whole thing has blown my mind TBH. I had no idea it was going to result in anything like that!

    Thanks so much for your time.

    Just as a a curiosity, why is the formula "greyed out" in C39 and D39?

  12. #12
    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, large ? results based on user input for week number

    The formula exists only in one cell. B39. It looks greyed out until you place the cursor in B39 & click in the formula bar... then it's black. If you do that elsewhere, the formula simply vanishes.

    the results "spill" out from that cell. If there's anything else in a cell that needs to return a result you'll get a #SPILL error.

    TBH, I'm still learning how to use these so-called dynamic arrays, myself. The Excel Forum is lucky to have a few helpers whe really know what they're doing!!


    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.

  13. #13
    Registered User
    Join Date
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    Yeah, that i really interesting. I did see that the formula was in B39 but wondered how C and D were calling it to be used? or where in the formula it states that the results should be shown in C39 and D39 respectively. Sorry for the questions but am interested to understand this sorcery of yours

  14. #14
    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, large ? results based on user input for week number

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


    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

  15. #15
    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, large ? results based on user input for week number

    My last post for the day. Use the formula here, in this file, for your real stuff. It's in the right place and has the cosmetic error fixed.

    I'll be around from time-to time tomorrow... maybe... if there are issues.

    I have two intercontinental flights to get through. Harrumph.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    01-10-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    7

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

    Hi,

    I notice that if there is not 4 weeks worth of data the cell remains blank, is it possible to just use whatever data is available, even if it is just the current week selected?

  17. #17
    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, large ? results based on user input for week number

    There may a small misunderstanding here. If I select Wk 49... C39, C40, D39, D40, etc, populates correctly. The 4 wk average column shows an error for some cells. I intended it to be entirely blank... because I assumed that the 4wk average was the average of the PREVIOUS for weeks i.e. 45-48.

    What EXACTLY do you want it to show 45-48... 46-49 or what?

+ 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