+ Reply to Thread
Results 1 to 12 of 12

Index........match.............max!

  1. #1
    Registered User
    Join Date
    01-31-2018
    Location
    Australia
    MS-Off Ver
    MS Office pro plus 2016
    Posts
    15

    Index........match.............max!

    Greeting All,

    I have a challenge that seems like too much for me to handle and google search is not helping.

    I have 2 worksheets and one has a daily record of events (5 columns, starting with date, start value, high, low and end value, lets call this “data” all the values recorded are numbers or price fluctuation), I have constructed another simple worksheet and want to locate and link values from my database on the second sheet.

    In a simple form on sheet two I have 2 dates which the second one is always greater than first one (B2 and C2). I would like to create a formula in Cell B3 and B4 to place the MAX value and the corresponding date from “Data” worksheet
    I would like to look up my “data” between these 2 dates and find the highest price in column 3 and also the corresponding date in the same raw(in column 1)…..hopefully that makes sence!

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230
    If you could attach a sample of your workbook, it would be most helpfull. You can do this by clicking on Go Advanced>Manage Attachments>Browse>Open>Upload File>Close Window>Submit Reply. Thanks.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Index........match.............max!

    Sounds like you could use a helper column in your data sheet for this, using something like =if(and(cell-with-date>=1st-test-date, cell-with-date<=2nd-test-date), value,0)

    Then a (relatively) simple max(helper-column) should give you what you want.

    If you still have a problem, as suggested above, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    01-31-2018
    Location
    Australia
    MS-Off Ver
    MS Office pro plus 2016
    Posts
    15

    Re: Index........match.............max!

    Greeting,

    I think I managed to upload the file.
    In the 6yr cycle tab I am looking at 2 formulas in B4 and B5 to locate the highest value in Data Tab when the date falls between B2 and C2 (which is the same as B6).
    B5 requires the Max value and B4 requires the date that the max was located going back to the column A of the same row if it makes sense.

    sorry it is not the best looking data base.

    Regards
    A
    Last edited by Minitrader; 02-03-2018 at 03:28 AM.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: Index........match.............max!

    in B5

    =MAX(IF((Data!$A:$A>='6yr Cycle'!$B$2)*(Data!$A:$A<='6yr Cycle'!$C$2),Data!$C:$C))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    in B4

    =INDEX(Data!A:A,MATCH('6yr Cycle'!C5,Data!C:C,0))

  6. #6
    Registered User
    Join Date
    01-31-2018
    Location
    Australia
    MS-Off Ver
    MS Office pro plus 2016
    Posts
    15

    Re: Index........match.............max!

    Thanks John. The Max worked mind you kept pressing enter!

    Somehow the Index comes up #N/A!

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: Index........match.............max!

    Worked OK for me on your posted file.

    MAX should be entered as an array formula as per post.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: Index........match.............max!

    See attached

  9. #9
    Registered User
    Join Date
    01-31-2018
    Location
    Australia
    MS-Off Ver
    MS Office pro plus 2016
    Posts
    15

    Re: Index........match.............max!

    When I evaluate this formula
    =INDEX(Data!A:A,MATCH('6yr Cycle'!C5,Data!C:C,0))
    when it reaches to =INDEX(Data!A:A,MATCH('6yr Cycle'!C5,Data!C:C,0))
    then the next part changes that to 0

    Of course I have already done the Max and there is a value of 3992.64 there!

  10. #10
    Registered User
    Join Date
    01-31-2018
    Location
    Australia
    MS-Off Ver
    MS Office pro plus 2016
    Posts
    15

    Re: Index........match.............max!

    Oh it need to be B5!!

    your previous post indicated :
    =INDEX(Data!A:A,MATCH('6yr Cycle'!C5,Data!C:C,0))

    and your input in the excel was
    =INDEX(Data!A:A,MATCH('6yr Cycle'!B5,Data!C:C,0))

    C5 is empty at the moment! LOL

    Great. I think it is working. I am just going to see if I can fill the other rows as well quickly. I'll keep you posted.

    Thanks John

  11. #11
    Registered User
    Join Date
    01-31-2018
    Location
    Australia
    MS-Off Ver
    MS Office pro plus 2016
    Posts
    15

    Re: Index........match.............max!

    Thank you, thank you, thank you John.

    I just entered those formula in over 700 cells each. I have been trying for over a week to come up with some model and although the journey is just starting, I was stuck at this part.

    the formula was much simpler than I thought. Clearly I need to take some courses! LOL

    Regards
    Amin

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: Index........match.............max!

    No gain without pain ... we have all been there!!!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. 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. [SOLVED] INDEX+MATCH instead of VLOOKUP+MATCH, why is INDEX a better choice and how to re-write?
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2016, 10:54 AM
  2. [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
  3. [SOLVED] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  4. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  7. Replies: 3
    Last Post: 05-02-2013, 01:31 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