+ Reply to Thread
Results 1 to 6 of 6

Help with Lookup/match/index with 2 criteria.

  1. #1
    Registered User
    Join Date
    09-14-2004
    MS-Off Ver
    2010
    Posts
    30

    Help with Lookup/match/index with 2 criteria.

    \1

    I'm trying to do a lookup based on 2 criteria. 1 is a general column, and the other is a value to look up in that column. In the attached screenshot, cells B2:D4 would be a named range "ItemsFound" and cells A2:A4 would be a named range "ItemResults". I've used the next largest integer in the ItemsFound so I can use a match formula with a -1 to find the next smallest value. This way if it's somewhere in between my criteria it can still find it. I'm getting confused as to how to also base it on difficulty.

    I think a way to simplify the question would be how would I use a match function to lookup values in a single column of a larger array? My real data has 70+ columns to look through.
    Last edited by Fizziii; 04-28-2011 at 10:01 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Help with Lookup/match/index with 2 criteria.

    Name the Range B1:D1 something like Difficulty

    and then use another MATCH in the INDEX function for the column.

    i.e.

    =INDEX(ItemsFound,Match(B9,ItemResults,0),Match(B7,Difficulty,0))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

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

    Re: Help with Lookup/match/index with 2 criteria.

    What use is that screenshot?

    If you are serious about needing help, then begin by helping us to help you.

    Post a sample workbook using the forum facilities!

    See how in this link
    Forum Rules

    [EDIT]
    @ NBVC How did you manage to see that screenshot? !!!!!
    Last edited by Marcol; 04-28-2011 at 09:36 AM.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,577

    Re: Help with Lookup/match/index with 2 criteria.

    My solution, similar to NBVC's but I couldn't get his to work

    =INDEX(ItemResults,MATCH(B8,INDEX(ItemsFound,,MATCH(B7,Difficulty,0)),1))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Help with Lookup/match/index with 2 criteria.

    Quote Originally Posted by ChemistB View Post
    My solution, similar to NBVC's but I couldn't get his to work

    =INDEX(ItemResults,MATCH(B8,INDEX(ItemsFound,,MATCH(B7,Difficulty,0)),1))
    Mine wasn't a solution, per se, it was just to show that the OP needed to reference the column Headers to make a "column match".

    Your solution is probably what they are looking for

  6. #6
    Registered User
    Join Date
    09-14-2004
    MS-Off Ver
    2010
    Posts
    30

    Re: Help with Lookup/match/index with 2 criteria.

    NBVC & Chemist, thank you for your efforts. Like Chemist, I was unable to get NBVC's method to work.
    I see how Chemist's is working and it's not doing what I want, but that's because of my own misunderstanding as to how the "less than" results worked.

    By changing the values in my table, I will be able to make this work. Thank you both again and have a wonderful day.

    NBVC, I see what you were going for by referencing the columns. I also didn't realize I could omit values in the Index function to just get a column/row.

+ 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