+ Reply to Thread
Results 1 to 5 of 5

How do I use two fields to determine lookup value?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-06-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    How do I use two fields to determine lookup value?

    I'm sure it is possible to solve this with an array, despite all my efforts having produced nothing so far.

    Attached is an example workbook. On the 'Data' sheet, every month the data will change and I need to fill in column A, with the approriate Name from the 'Map' sheet.

    Is this possible using an array?

    Thanking you in advance
    Attached Files Attached Files
    Last edited by Militia; 06-09-2009 at 08:20 AM.

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

    Re: How do I use two fields to determine lookup value?

    Try:

    =INDEX(Map!$C$2:$C$8,MATCH(1,(Map!$A$2:$A$8=B6)*(Map!$B$2:$B$8=C6),0))

    change ranges to suit and confirm with CTRL+SHIFT+ENTER
    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 DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How do I use two fields to determine lookup value?

    You could use LOOKUP rather than an Array, eg:

    A6:
    =LOOKUP(2,1/((Map!$A$2:$A$8=$B6)*(Map!$B$2:$B$8=$C6)),Map!$C$2:$C$8)

    Where the combination does not exist you will get an error - given you are seemingly always returning a text string you can handle this without resorting to double evaluation using:

    A6:
    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",LOOKUP(2,1/((Map!$A$2:$A$8=$B6)*(Map!$B$2:$B$8=$C6)),Map!$C$2:$C$8)))

    (change the Null to whatever you want to appear where error occurred trying to locate the combination)

  4. #4
    Registered User
    Join Date
    03-06-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: How do I use two fields to determine lookup value?

    Thank you both very much for your help.

    Both worked just as I needed!

    -Militia

  5. #5
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Re: How do I use two fields to determine lookup value?

    Could you please explain this with more detail. I've read about array formulas but they are not my friend. Thanks.

+ 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