double or nested vlookup

P

PaulaB

Is there a way to look up not just one value, but two, in order to give an
output?
For example, column A has values A through D, repeated 5 times, and column B
has 1 through 10 repeated twice. Column C is the output value. How to I get
another worksheet to give me the value from C and 5 since Vlookup will only
find either C or 5?
 
N

Niek Otten

Insert an extra column in which you concatenate A and B (=A1&B1).
Concatenate the search arguments too.
 
P

Pete_UK

One way is to insert a new column C in your table and to concatenate
columns A and B together:

=A1&B1

Then your VLOOKUP can refer to column C as a unique reference, like
this:

=VLOOKUP(F1&G1,C:D,2,0)

assuming F1 contains "C" and G1 contains 5.

Hope this helps.

Pete
 
J

JBeaucaire

=INDEX(C1:C20,MATCH("C5",A1:A20&B1:B20))

Confirm that formula with CTRL-SHIFT-ENTER to activate the array. You will
see braces appear around your formula { } and the formula should return the
value from cell C15.
 
D

Dave Peterson

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Vlookup or similar 7
VLOOKUP HELP 7
Macro to find duplicates 4
Using Offset with Vlookup 2
Vlookup help 2
Scrabble Value calculation for Welsh words 0
IF and Vlookup 1
Summing values of same names 4

Top