+ Reply to Thread
Results 1 to 9 of 9

Finding date that corresponds to highest value in range in table

  1. #1
    Registered User
    Join Date
    12-05-2021
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    7

    Question Finding date that corresponds to highest value in range in table

    I have a table in which I record COVID mortalities which I am using for a research project. I have succeeded in finding the peak value for each wave wave of the pandemic, using the start and end date of each wave.
    1. My E-page contains the date under column A, the total number of mortalities under column B and the difference between the current date and the day before in column C.
    2. the cell AQ3 contains the date on which the wave started and AW3 contains the date when the wave ended.
    3. The following formula extracts the highest value between the two dates (in this case the value is 44 and appears in the cell =E!C682)
    =MAX(INDIRECT(CELL("address",INDEX(E!$A:$C,MATCH(AQ3,E!$A:$A,0),3))):INDIRECT(CELL("address",INDEX(E!$A:$C,MATCH(AW3,E!$A:$A,0),3))))
    4. I now want the date which corresponds to that value, i.e., I want the value in Cell =E!A682
    5. I tried the formula =INDEX(E!$A:$A,MATCH(AZ3,E!$C:$C,0)), but because the number 44 occurs more than once in the table, the date is incorrect.

    I am trying to find a way to change the above MATCH formula so that it only finds the match between the two dates in AQ3 and AW3.
    Alternatively, I want to find the date in the cell in column A which corresponds to the cell in column C where I extracted the value of "44". The correct date should be 02-Dec-2021 and not 23-Nov-2021 as this falls before the start of the fourth wave (29 November)
    Below is how the raw data appears in my page E (The date is Column A, the value Column B and the difference Column C while the number 671 - 684 are the row numbers):


    671 21-Nov-2021 89574 2
    672 22-Nov-2021 89584 10
    673 23-Nov-2021 89628 44
    674 24-Nov-2021 89657 29
    675 25-Nov-2021 89771 114
    676 26-Nov-2021 89783 12
    677 27-Nov-2021 89791 8
    678 28-Nov-2021 89797 6
    679 29-Nov-2021 89822 25
    680 30-Nov-2021 89843 21
    681 01-Dec-2021 89871 28
    682 02-Dec-2021 89915 44
    683 03-Dec-2021 89944 29
    684 04-Dec-2021 89965 21

    Any help would be highly appreciated.
    Thanks
    Arnau
    Attached Files Attached Files
    Last edited by Arnauvw; 12-05-2021 at 05:56 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Finding date that corresponds to highest value in range in table

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-05-2021
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    7

    Re: Finding date that corresponds to highest value in range in table

    Sorry about the mix-up. I'm new to the forum and still trying to find my way. I hope everything is fine now.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Finding date that corresponds to highest value in range in table

    Yes, thanks.

  5. #5
    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,063

    Re: Finding date that corresponds to highest value in range in table

    1. I wouldn't use thta formula with address and indirect. INDIRECT, being volatile can cause BIG performance issues. Use this instead:
    =AGGREGATE(14,6,E!$C$2:$C$20/((E!$A$2:$A$20>='SA Stats'!AQ3)*(E!$A$2:$A$20<='SA Stats'!AW3)),1)

    To return the date, use this:
    =INDEX(E!A:A,AGGREGATE(14,6,ROW(E!$C$2:$C$20)/((E!$A$2:$A$20>='SA Stats'!AQ3)*(E!$A$2:$A$20<='SA Stats'!AW3)),1))
    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

  6. #6
    Registered User
    Join Date
    12-05-2021
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    7

    Re: Finding date that corresponds to highest value in range in table

    Thanks Glenn. The first part of the formula works correctly (AZ3) but the date is wrong. It should be 2 December (E!A14) and not the largest date (E!A16). I assume something just needs to be tweaked.

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

    Re: Finding date that corresponds to highest value in range in table

    Hahaha. No not a tweak, I just need coffee. Wrong formula, from end-to-end.

    =INDEX(E!$A$2:$A$20,MATCH(1,INDEX((E!A2:A20>='SA Stats'!AQ3)*(E!A2:A20<='SA Stats'!AW3)*(E!C2:C20='SA Stats'!AZ3),0),0))
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-05-2021
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    7

    Re: Finding date that corresponds to highest value in range in table

    Thanks. That seems to have done what I wanted it to do. Thanks so much. This is a great help.

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

    Re: Finding date that corresponds to highest value in range in table

    You're welcome!

+ 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] Return the Value from the Range that corresponds to Max Date.
    By T.I. in forum Excel General
    Replies: 8
    Last Post: 02-26-2021, 04:54 PM
  2. [SOLVED] Finding Highest value in a column between specific date range
    By orshims in forum Excel General
    Replies: 15
    Last Post: 01-21-2015, 03:21 PM
  3. Trying to put data in a table that corresponds to a date
    By superdaw in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-17-2014, 06:49 AM
  4. [SOLVED] Help with finding highest value in a range
    By kochark in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-21-2014, 11:29 AM
  5. Replies: 3
    Last Post: 05-19-2014, 05:19 PM
  6. Finding 2nd or 3rd highest value in range
    By jmhultin in forum Excel General
    Replies: 4
    Last Post: 03-11-2013, 06:38 AM
  7. Replies: 5
    Last Post: 11-07-2012, 02:15 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