+ Reply to Thread
Results 1 to 4 of 4

Formula to lookup two values in a row and return a value if both are found

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    79

    Formula to lookup two values in a row and return a value if both are found

    I am trying to use a formula similar to VLOOKUP() to look in a table for two values and if both values are found, return another value.

    Sheet2 is an example of my output file, sheet one is a generated file. i would like the vlookup formula in sheet 2 cell D2 and down to be something like this,
    =VLOOKUP(A2,Sheet1!A:K,10) but I would like to lookup A2 and B2, and the row that contains both values, return the value in the J column

    Thanks for any help
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formula to lookup two values in a row and return a value if both are found

    Hi,

    Unless you're prepared to use helper columns which concatenate the two fields you're interested in you'll need an array formula like the one below which should be entered in D2 by Ctrl-Shift-Enter

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Formula to lookup two values in a row and return a value if both are found

    Try this arrayed formula in D2

    =INDEX(Sheet1!$J$2:$J$12, MATCH(A2&B2,Sheet1!$A$2:$A$12&Sheet1!$G$2:$G$12,0))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    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

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    2,265

    Re: Formula to lookup two values in a row and return a value if both are found

    Hope it works.....
    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)

Similar Threads

  1. search a cell for values in a range, return values found
    By carpe.cervisiam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2011, 12:52 PM
  2. Replies: 4
    Last Post: 04-16-2010, 09:28 AM
  3. Return number of days until a date found in a lookup table
    By midwestgirl80 in forum Excel General
    Replies: 1
    Last Post: 08-08-2009, 10:07 PM
  4. can lookup return err if no match found
    By Kim Greenlaw in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-11-2006, 01:45 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