+ Reply to Thread
Results 1 to 4 of 4

Index/match statement for multiple answers

  1. #1
    Registered User
    Join Date
    02-20-2017
    Location
    Maine
    MS-Off Ver
    excel 10
    Posts
    22

    Index/match statement for multiple answers

    Hello, i have a problem that is a bit perplexing for me.

    I work for a hospital and the administrators are inquiring as to what hours during the day are the busiest for admission. I am trying to come up with a way to "automate" the answers, rather than look through a table and count.

    I know I can find the highest amount of admissions by utilizing the =MAX statement. The issue is telling me what hours are the busiest when there are two or more hours with the same answer.

    For example, if one looks at the attached spreadsheet for the month of January, the highest number of admissions taken is 3 which would give 1400 & 1600 hours as the busiest times. Is there a way to provide both times in an answer? I tried =INDEX($A$4:$A$27,MATCH(B30,$D$4:$D$27,0)) but that only provides one of the two hours (1400) as an answer.

    Thank you very much in advance,

    Lance
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-21-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    25

    Re: Index/match statement for multiple answers

    Hi ljbrown,

    you could use the following:

    =INDEX(INDIRECT(CONCATENATE("$A$",MATCH($B$30,$B$1:$B$27,0)+1,":$A$27")),MATCH($B$30,INDIRECT((ADDRESS(MATCH($B$30,$B$1:$B$27,0)+1,2)&":$B$27")),0))

    Put this in the cell below the first time that is found, what it does is tell excel to start the match function from the cell below the first value found.

    So the first value 14:00 is found in B18, so that will tell excel to run the match function from B19:B27 and return the corresponding data found in A19:A27

    The only downside to this would be that it would find the 2nd MAX time, but if there is a 3rd or 4th you wouldn't find this.

    Hope this helps
    Dan

  3. #3
    Registered User
    Join Date
    02-20-2017
    Location
    Maine
    MS-Off Ver
    excel 10
    Posts
    22

    Re: Index/match statement for multiple answers

    Hi Dan! Thank you so much! That did work, but sometimes there can be up to 4 time slots with the same answer. Is there a way to report on that? I.e Busy Hour 1, Busy Hour 2, Busy Hour 3, etc.

    Thank you so much with your help! I amended the spreadsheet so there are four "correct" entries if that helps.

    I am also attempting to learn this. Kind of like "Teach a person to fish..."

    Lance
    Attached Files Attached Files
    Last edited by ljbrown; 07-06-2017 at 09:11 AM. Reason: amended spreadsheet

  4. #4
    Registered User
    Join Date
    05-21-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    25

    Re: Index/match statement for multiple answers

    Hi Lance,

    Using the previous method will get quite messy in that case. If you have no issues with having a hidden column to the left of the data, then this method will work the best, and is a combination of formulas which Is much easier to understand.

    Im on IE at work so the upload button wont work for me, so insert a column to the left of column A

    In A4 insert the following formula:

    =IF(C4=MAX($C$4:$C$27),"Busy Hours "&COUNTIF($C$4:C4,MAX($C$4:$C$27)),"")

    What this will do is check if it is one of the MAX admissions, and if it is it will assign it with "Busy Hours 1" then "Busy Hours 2" and so fourth.

    Drag this to the bottom of you data set and then it is a simple vlookup from the table you have made at the bottom.

    =IFERROR(VLOOKUP($B31,$A:$B,2,0),"") - That will lookup "Busy Hour 1" and return 14:00

    Any issues let me know.

    Many Thanks
    Dan

+ 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] Finding Multiple Answers with Index Match
    By ScabbyDog in forum Excel General
    Replies: 2
    Last Post: 03-09-2016, 05:43 PM
  2. Formula Index matching multiple answers
    By a1b2c3d4e5f6g7 in forum Excel General
    Replies: 4
    Last Post: 03-23-2015, 06:19 AM
  3. Index/ Match and Concatenate on muliple answers
    By Burt_100 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-05-2014, 03:41 PM
  4. Index Match formular - Multiple Answers
    By Henry c in forum Excel General
    Replies: 9
    Last Post: 05-20-2010, 07:18 AM
  5. Replies: 1
    Last Post: 06-30-2006, 08:35 PM
  6. MATCH w/ multiple answers?
    By fastballfreddy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-11-2006, 01:50 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