+ Reply to Thread
Results 1 to 12 of 12

INDEX MATCH with MAX and MIN Combined

  1. #1
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    INDEX MATCH with MAX and MIN Combined

    I have another strange one.

    The attached should better demonstrate what I probably wont be able to articulate in words now. The data in the attached is sample data.

    I need to look across a table of data and find where the columns for resource1, 2 and 3 have results in (there could be up to 24 rows and 36 columns that have results in. I have put a little helper column in to do this (count if).
    I then need sum the results and then determine which one is cheapest. (I have put a little helper column in to do this (sum if).
    Once i have done that, pull the results from the table and put into another cell (the cells in red on the attached).

    The descending order of results would be
    3 matches (cheapest)
    3 matches more expensive +
    2 matches cheapest
    2 matches more expensive+.....
    1 match cheapest
    1 match more expensive +....

    Any help with a formulae for this would be very much appreciated.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    Re: INDEX MATCH with MAX and MIN Combined

    Slightly amended file as there were a few more areas highlighted in red that I need populating. Many thanks whoever can help.
    Attached Files Attached Files

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: INDEX MATCH with MAX and MIN Combined

    OK, took me a while to work out the requirement, but I think I'm there!

    I've added formulas to all the red cells. Some are just sums and therefore self explanatory. Others are a little more complicated.

    The below is the formula from M31. The rest are build around the same principle, but with ranges amended to suit.

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


    This formula is finding instances of 3 in your helper column then finding the minimum value against a 3. It then uses that to lookup the rest of the values using an INDEX/MATCH. For the subsequent sections if looks for the minimum value against 2 and then against 1.

    It is an array formula and therefore needs to be confirmed with Ctrl+Shift+Enter.

    Hope it makes some sense as well as does what you need.

    Let me know.

    BSB
    Attached Files Attached Files
    Last edited by BadlySpelledBuoy; 07-06-2018 at 05:06 AM.

  4. #4
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    Re: INDEX MATCH with MAX and MIN Combined

    Hi - You have helped me out twice in two days so thank you and serious hats off to you. I understand the logic so thank you. I just need to adapt it slightly as there may be 3 or 2 instances where "3" is featured which is where I keep falling down .

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: INDEX MATCH with MAX and MIN Combined

    So if there are multiple instances of 3 then those should be shown rather than a 3, a 2 and a 1?

    BSB

  6. #6
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    Re: INDEX MATCH with MAX and MIN Combined

    Yes - sorry I tried to explain above in the original post

    "The descending order of results would be
    3 matches (cheapest)
    3 matches more expensive +….. and only when this is exhausted then
    2 matches cheapest
    2 matches more expensive+..... and only when this is exhausted then
    1 match cheapest
    1 match more expensive +....

    also there may be a value in "D" if the user selected hours instead of days - I have tried to modify your formulae to accommodate but that does not work:

    =IF(G23>0,INDEX($F$6:$F$19,MATCH(MIN(IF(($Q$6:$Q$19=3),$R$6:$R$19)),$R$6:$R$19,0)),INDEX($D$6:$D$19,MATCH(MIN(IF(($Q$6:$Q$19=3),$R$6:$R$19)),$R$6:$R$19,0)))

    I really appreciate your help - I think you know that !

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: INDEX MATCH with MAX and MIN Combined

    OK, gotcha now. I'll have to have a bit of a think on the best way round that though. I'll hopefully come back with a solution soon (need to pop out for a while).

    Throwing a whole other element into it with the days/hours thing... Can I just check if the user has selected hours then columns D, H & L will have figures and columns F, J & N will all show zeros, and the other way round if days is selected?
    What I'm getting at is there will be no times when some show hourly figures and some show daily??

    BSB

  8. #8
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    Re: INDEX MATCH with MAX and MIN Combined

    that's exactly right I will deal with the weekly item if a user chooses thin in the user data entry part by (x) the daily by five so dont need to cater for that

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: INDEX MATCH with MAX and MIN Combined

    I've added a couple more helpers to this version. The first takes the count number from col Q and a ranked value from R based on the count number and turns them into a decimal number.
    The second ranks those decimal numbers. I've then changed the array formulas that were doing the lookups before for straight forward INDEX/MATCHes to bring back the results bases on this second rank helper.

    If there are 3 "3"s it will show those, if there are 2 "3"s and a "2" it will show those. Hopefully that's what you meant!

    You will be able to use your logic from earlier to check if G23 >0 and if so look in hourly columns rather than daily columns.

    BSB

    EDIT:
    This in S6 and copied down would be a nicer formula (same result though)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by BadlySpelledBuoy; 07-06-2018 at 06:24 AM.

  10. #10
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    Re: INDEX MATCH with MAX and MIN Combined

    OMG - THANK YOU.... A MILLION THANK YOUs!!!!! you have saved my bacon. I hope you have a fantastic weekend

  11. #11
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    27

    Re: INDEX MATCH with MAX and MIN Combined

    If I could give you another appreciation I would - sorry!

  12. #12
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: INDEX MATCH with MAX and MIN Combined

    Happy to help mate

    BSB

+ 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 combined with Sumproduct #N/A Issue
    By storm170 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-23-2017, 05:38 PM
  2. Index/Match combined with Count
    By andvan in forum Excel General
    Replies: 2
    Last Post: 02-12-2017, 09:49 AM
  3. Combined count if and index match
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2016, 12:00 PM
  4. INDEX and MATCH(?) combined with SUM across multiple sheets
    By jusmightbeokay in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-14-2014, 06:14 AM
  5. [SOLVED] Combined INDEX and MATCH formula will not work - pls help!
    By Postlki1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-06-2013, 08:03 AM
  6. INDEX , MATCH ,INDIRECT Combined usage example - Pls
    By TKD in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-24-2012, 09:32 AM
  7. INDEX, MATCH, and IF functions combined
    By veeeSix in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-23-2012, 01:28 PM

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