+ Reply to Thread
Results 1 to 8 of 8

Index/Match based on multiple criteria

  1. #1
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Index/Match based on multiple criteria

    Hello guys,

    Hoping I can get yet some more assistance from you kind people.

    I've attached a file which contains columns of numbers, names, 2 criteria columns, and a rate column. What I'm trying to do is to type a name into B19, and have (in the attached example) a value returned for that name, provided the criteria in columns C & D ("yes" & "full") are met.

    I've made an attempt at an Index/Match formula that I though should work, but am getting a #Value error. In this example, the value returned should be E8 - "100" - as this is the cell which matches the name query in B19, and which has corresponding values of "yes" & "full".

    Any help would be much appreciated.

    Thank you,

    Brendan.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Index/Match based on multiple criteria

    One way

    =LOOKUP(2,1/($B$2:$B$13=B19)/($C$2:$C$13="yes")/($D$2:$D$13="full"),$E$2:$E$13)

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Index/Match based on multiple criteria

    BB1972,

    Give this a try in cell D19 using your provided sample file:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Index/Match based on multiple criteria

    Try this array formula (confirmed with CTRL+SHIFT+ENTER):

    =IF(B19="","",INDEX(E2:E13,MATCH(B19,IF((C2:C13="Yes")*(D2:D13="Full"),B2:B13,0),0)))

  5. #5
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Index/Match based on multiple criteria

    Gentlemen,

    Thank you all very much for your help - these all work.

    As a matter of interest - are there any advantages (or disadvantages - processing time, etc) to using an array formula, rather than one of the other two?

    Brendan.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Index/Match based on multiple criteria

    BB1972,

    Array formulas can be very handy indeed, and there are times when they are the only option to avoid VBA. However, They are very inefficient and processor intensive because they calculate every cell 1 at a time. Having too many array formulas can and will slow/bog down excel. If you're only using a few array formulas, its no big deal. See here for more information:
    http://www.ozgrid.com/Excel/arrays.htm

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Index/Match based on multiple criteria

    With a moderate amount of data I doubt there would be any noticable difference. Although 2 of the suggestions don't require array confirmation, there still operate on the same principles as an array formula would.

    There are other criteria that would dictate the calculation time as much as if the formula is array confirmed or not, functions used, data range, etc.

    The best way to test performance of a formula is to over-use it on a test worksheet with approx 10k rows of data and 1k formula, time the calculation with vba, then repeat the process with a different version of the formula and compare the results.

  8. #8
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Index/Match based on multiple criteria

    Fantastic. Thank you all for your input, and have a great weekend

    Brendan.

+ 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