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

1. ## 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

2. ## 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:
`Please Login or Register  to view this content.`

3. ## 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.

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

Hope it works.....

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

#### 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