+ Reply to Thread
Results 1 to 13 of 13

MATCH multiple criteria then select the smallest value >= the lookup value

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    10

    MATCH multiple criteria then select the smallest value >= the lookup value

    I am trying to use OFFSET with INDEX/MATCH to MATCH on 2 criteria:'IsPro?' and 'Price Schedule', then find the smallest 'Break-even Txns' that is >= my lookup value. I have been successful retrieving other data cells using OFFSET/INDEX/MATCH, but I am having trouble finding the smallest break-even txns >= my lookup value.

    So, assume I am looking up a Basic SDK account with projected transactions of 19,704, it should return 'Tier' = 14,400.

    Tiers.PNG

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    Post a workbook with some sample data and I'll try it. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    Thanks for responding. Here is some sample data. Again, I am comfortable with the OFFSET, INDEX and MATCH functions, but once I match on IsPro and Price Schedule, I cannot find the smallest BreakEven Price that is >= the lookup value. I have tried using Match Type = -1, but it only returns #N/A.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    No attachment seen. Try again.

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    Sample data attached
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    1) Sort the table by col A ascending, col B Asc, col C Asc.
    2) Then this monster OFFSET will work in D86:

    =INDEX(OFFSET($A$1, MATCH(A86&B86, INDEX($A$1:$A$81&$B$1:$B$81, 0), 0)-1, 2, COUNTIFS($A$1:$A$81, A86, $B$1:$B$81, B86), ), MATCH(C86, OFFSET($A$1, MATCH(A86&B86, INDEX($A$1:$A$81&$B$1:$B$81, 0), 0)-1, 2, COUNTIFS($A$1:$A$81, A86, $B$1:$B$81, B86), ), 1))


    If you want to see a simpler break down, look over in K86 and L86. These are the parts that solve specific parts of the puzzle. The formula in M86 is MUCH easier to read usig those references. The big formula in D86 has simply subsituted the references to K86 and L86 with the actual formulas in those cells.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-14-2013
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    Hi,

    You can look at the attached file. First I wrote the formula in the cell E2 and copied it down. Then I wrote the formula in the cell H1. It works correctly.
    Attached Files Attached Files

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    The simplest way is as, singapore suggests, use a helper column.

    Sheet1 Uses a helper column, Column H. (Hidden with the +/- grouping button)
    The result is in L1, and is non-volatile.

    Sheet2 Offers a CSE array based solution.
    Option 1, in $I$3 is an alternative to Jerrys' "monster", It's even longer, but it works in all versions of Excel.
    The other options use helper cells to cut down the formula size, and should help you to understand the "Big Yin"

    Note
    Neither sheet needs sorting.

    I'd go with Sheet1. --- ...
    Attached Files Attached Files
    Last edited by Marcol; 03-08-2013 at 11:30 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Registered User
    Join Date
    12-12-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    JBeaucaire, thanks for your response. Your formula works some of the time. If I enter lookup values = Basic, SDK, 650, your formula returns tier 360, but it should be 720.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    your parameters indicated you wanted the value below the numeric, not above.

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    Have you tried the attachment in post #8?

    Both sheets seem to return the answer you expect for
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-12-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    Yes, I tried Sheet1 and it works well, thanks. I do not understand what is happening in the helper column, and in the lookup formula I do understand what SMALL(F:F,1) does. I have applied your formula to my spreadsheet and adjusted the cell references, etc., and I cannot figure out what I did wrong. I am getting #NUM as a result. When I debug the formula, the SMALL function appears to be the problem. Sorry, I cannot share more of my spreadsheet due to confidential info. Thanks for your help.
    Last edited by BaldEagle199; 03-08-2013 at 03:00 PM.

  13. #13
    Registered User
    Join Date
    02-14-2013
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: MATCH multiple criteria then select the smallest value >= the lookup value

    In the post # 8, in Sheet 1, the formula in the helper column is really better than my previous suggestion. So I revised and shortened my previous formula, it seems to work correctly for all lookup values.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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