Double lookup!

Cyril.exe

New Member
Joined
Mar 19, 2002
Messages
5
Hi

I have 1 table with date in column A and and 3 digit code in column B. The 3 digit codes appear once each date. Columns C-H have the data which I want to fill cells in several other tables (each one for a diferent 3 digit code), set out by date.
My aim if to create a formula which will go and get the data in C-H if A="date" and b="3 digit code" I have tried diferent combinations of match, Index, and Vlookup but cannot seem to get the data I want to fill the cells.
I would also be interested in any macro solutions that would do the trick.

cheers
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Cyril,

Lets say that A1:E3 houses the following sample data and you want to retrieve the value from val2 column of this table, which is associated with lookup values in G2 (a date) and H2 (a digit code).

{"date","code","val1","val2","val3";
37258,"023",3,4,5;
37258,"024",6,45,8}

Strange looking numbers are just dates in the internal representation that Excel uses for dates.

In G2 we have: 1/2/02
In H2 we have: 024

In I2 enter:

=IF(SUMPRODUCT(ISNUMBER(MATCH(G2&H2,$A$2:$A$3&$B$2:$B$3,0))+0),INDEX($D$2:$D$3,SUMPRODUCT(MATCH(G2&H2,$A$2:$A$3&$B$2:$B$3,0))),"")

where $D$2:$D$3 in INDEX is the column from which we want to retrieve the associated value.

Note. If you're going to use this formula in lots of cells, it will incur some performance costs.

Aladin
 
Upvote 0
Hi again and THANKYOU!!

I tried both your idea's but Aladins proved the more useful. Thanks for taking the time (altho your reply's were super fast!!)

Cheers
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,034
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top