Pull Data From Two Tables Using 2 Drop Lists

FiddleRox

New Member
Joined
Aug 30, 2015
Messages
4
I am attempting to match data (state and year) in two tables that have the same h row and v column headers by using 2 drop list
StateYearPopulationCases
Drop ListDrop ListResult From Table 1Result From Table 2

<tbody>
</tbody>


Both tables would look similar to the following:

Table 1 (Population)

STATE1960196119621963
AlabamaAAAAABBBBBCCCCCDDDDD
AlaskaEEEEEFFFFFGGGGGHHHHH
ArizonaIIIIIJJJJJKKKKKLLLLL

<tbody>
</tbody>



Table 2 (Cases)


STATE1960196119621963
AlabamaAAAAABBBBBCCCCCDDDDD
AlaskaEEEEEFFFFFGGGGGHHHHH
ArizonaIIIIIJJJJJKKKKKLLLLL

<tbody>
</tbody>



I need the 2 drop lists (State and Year) to pull data and match the desired cells (state and year) from each table into the corresponding cells (Population and cases). For example: Alaska and 1962 from both tables.

The code that I have in the cell "Result From Table 1" is - =VLOOKUP(B3,A12:CN62,HLOOKUP(C3,B10:CN11,2,FALSE),FALSE). That works the way it should.

The code that I have in cell "Result From Table 2" is - =VLOOKUP(B3,A79:CN129,HLOOKUP(C3,B77:CN77,2,FALSE),FALSE). This code give me the #REF! error.

How can I get my desired result in the cell "Result From Table 2"?

Please help. I thank you in advance.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Your HLOOKUP is reporting #REF because you've put a 2 in the 'row index' argument but have declared only one row in the 'table array' argument.

I think most would suggest INDEX & MATCH is a superior way to go. Like this:

Excel 2012
ABCDE
1StateYearPopulationCases
2Alaska1962GGGGG
3
4Cases
5STATE1960196119621963
6AlabamaAAAAABBBBBCCCCCDDDDD
7AlaskaEEEEEFFFFFGGGGGHHHHH
8ArizonaIIIIIJJJJJKKKKKLLLLL

<tbody>
</tbody>
Sheet4

Worksheet Formulas
CellFormula
D2=INDEX(A5:E8,MATCH(A2,A5:A8,0),MATCH(B2,A5:E5,0))

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,635
Members
449,043
Latest member
farhansadik

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