Lookup value based on 2 cell values

  • Thread starter Thread starter BorderMaster
  • Start date Start date
B

BorderMaster

Hello all,

I am trying to find a way to search through a table the value based on
2 other cells. The 2 base cells have 9 and 10 different possibilities
respectively so this gives me a table with 90 options. How can I do
this? My first thought was something like this:

=IF(A1="LCT";VLOOKUP(B1;D1:M9;2);IF(A1="LCB";VLOOKUP(B1;D1:M9;3);...)

The problem is that I have more than 7 "IF" and I cannot do this in
Excel 2K3.

Can someone help me? I would like to be able to grow the table as
needed.

Thanks in advance.
 
Hi

Would you post your sample and your expected result
as not sure why you need to IF statements.

HTH
--
Pls provide your feedback by clicking the Yes button below if this post have
help you. This will help others to search the archives for result better.


Thank You

cheers, francis
 
Hi,

The +1 is added because the MATCH returns 1 or 2 depending on which one you
were looking for, but in the VLOOKUP range the column from which you want to
return the result is either 2 or 3 because the first column is the lookup
column so +1.

You can also use
=SUMPRODUCT((E1:M1=A1)*(D2:D11=B1)*E2:M11)

where the data range looks something like:
E F G ....
1 LCT LCB
2 B 77 19
3 A 35 6
4 C 29 23
5 D 61 5
6 E 10 56
7 F 68 89
8 G 28 70
9 Z 62 35
10 N 45 44

And you enter the items you want to search for in A1 and B1.

By using range references you make the formula a lot more flexible.

Where the
 
Do you have column headers in your table that are LCT, LCB ?

Like this:

...........D..........E...........F
1..................LCT......LCB
2.......0..........10..........12
3.......5..........14..........17
4.......7..........11..........20

If so:

=VLOOKUP(B1;D1:F4;MATCH(A1;D1:F1;0))
 
Hi BorderMaster,

As you can see by the last two responses, the earlier responses are
guesswork because you didn't show us what your data area looks like.

Good points T.V and HTH!
 
Hi BorderMaster,

As you can see by the last two responses, the earlier responses are
guesswork because you didn't show us what your data area looks like.

Good points T.V and HTH!
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

Thanks everyone,

Sorry for the late response, I was away for a while.

I used something like T.V. wrote where the LCT, LCB... are headers. It
works perfectly.

GM
 
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


Hi BorderMaster,

As you can see by the last two responses, the earlier responses are
guesswork because you didn't show us what your data area looks like.

Good points T.V and HTH!
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

Thanks everyone,

Sorry for the late response, I was away for a while.

I used something like T.V. wrote where the LCT, LCB... are headers. It
works perfectly.

GM
 
Back
Top