vlookup to see 2 values?

A

alex

Hi..

Normally for vlookup u would look for a single value. now
i want to use 2 cells to do a vlookup.
i tried looking on net ... i found something using index
and match. i didnt clear understand it.pls do tell me the
easier way out or maybe i am using a wrond approach

pls suggest
thanks
 
D

Domenic

Try the following array formula, entered using CONTROL+SHIFT+ENTER...

=INDEX(RangeC,MATCH(1,(RangeA="First Lookup Value")*(RangeB="Secon
Lookup Value"),0))

Note that if your lookup value is numerical, remove the quotes.

Hope this helps
 
D

Don

Alex,



To match both "Joe" in Range1 and "Jones" in Range2, and return the value in
"ValueRange"



=INDEX(ValueRange, MATCH(1,(Range2="Jones")*(Range1="Joe"),0),0)



Enter as an array formula
 
G

Guest

hi thanks for

i tired it and it works but one problem:
here is my data
Brian Red Fire Water
Brian Blue Water Water
John red volcano Water
john blue hurricane Water


the last column is my value i got thru :
=INDEX(C1:C4,MATCH(1,(A1:A4="Brian")*(B1:B4="Blue"),0),0)

all the values in last column comes out to be water? how
is it possible it should be water only for the 2nd case
for rest it shoudl be #n/a's??????//

am i doing anythign worng?

once again thanks a plenty
 
A

Alex Delamain

From your last post I am guessing that column D contains your looku
formula which has been array entered and copied down the list of data.

If this is the case then it will give "Water" as the result every tim
because it performs the same calculation on the whole data list ever
time. The idea behind using an array formula is that a single cell ca
check a whole list of data without having to be copied down all th
rows

If you intend to copy the formula down the data in another column the
the formula could be

=IF(AND(A2="Brian",B2="blue"),+C2,""
 
M

MikeY

D1: {=INDEX(C$1:C$4,MATCH(1,(A$1:A$4=A1)*(B$1:B$4=B1),0),1)}

Your wrong formula must be equivalent to;
{=INDEX(C$1:C$4,MATCH(1,(A$1:A$4=A$1)*(B$1:B$4=B$2),0),1)}
 
A

alex

no htis is not what i want... i am too confused.
my simple requirement is i want to do a vlookup with 2
column values rather than with one value.

pls suggest if its feasible.
thanks again
alex
 
P

Peo Sjoblom

It's still not clear, if you want to return the values from 2 columns like
if your lookup value
is in A3 and you want to return B3 and C3, then you need to select an array
and array enter
the formula

=VLOOKUP(lookup_value,A1:C100,{2,3},0)

to be entered with ctrl + shift & enter



--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
G

Guest

my lookup value is not a single value but i want 2 values
to be the "lookup_value"!
 
A

Alex Delamain

The sample is already there.

Brian Red Fire
Brian Blue Water
John red Volcano
john blue Hurricane

The question is: How does he write a formula which does the following
If column A is Brian and column B is Blue then the answer is the valu
in column c (ie Water)

In Alex's earlier post he shows a column D which is Water, Water
Water, Water because he has entered the following formula
=INDEX(C1:C4,MATCH(1,(A1:A4="Brian")*(B1:B4="Blue"),0),0)
and then copied it down for each row. The formula is working fine an
picking the correct answer each time but, because the same formula i
in D1 - D4 it returns the same answer in each row.

Alex - do you want the answer in a single cell?
If you do you already have a working formula. If you want to have
fourth column which returns an answer for each row - ie N/A, N/A
Water, N/A then my previous post holds true
in D1
=IF(AND(A1="Brian",B1="blue"),+C1,#N/A)

If neither of the above then please come back with a clear example o
what you want to achiev
 
S

Sigmaz

I am havina siliar problem however I have a dynamic sheet that is generated
by access looks like this:


A B C
COMPLETED By Day CODE_1 Multiplier
Friday, March 18, 2005 1 20
Monday, March 14, 2005
Saturday, March 19, 2005 1 25
Thursday, March 17, 2005 1 22
Thursday, March 17, 2005 4 1
Tuesday, March 15, 2005
Wednesday, March 16, 2005
Wednesday, March 16, 2005 1 1
Wednesday, March 16, 2005 4 1

Now this table can change from day to day depending on what the worker
does, So I need to beable to have another cell on another sheet come over
here and check on two cirteria,
1 Day of the week. i.e. Moday, then look to the job code and find the code 1
- 8 (job codes that are differant in price payout) then it can retrieve the
total of that job in column C to bring into the cell on the other sheet.
But because there can be multiple codes per day I need to have the formula
discriminate with the two lookup_values so I can make sure that the correct
data is being placed in the correct cell on the other page.
since this page is dynamic I guess I need to use =OFFSET to range the
formula?.. I dunno I just cant get it to work.
 

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

Top