Structured reference that refers to table name,a value in header row, and a value from 1st column

waltdakind

New Member
Joined
May 11, 2010
Messages
30
So, I have multiple tables that each represent a fiscal year. (TableFYE_2010, TableFYE_2011, TableFYE_2012, etc.,) and the tables are all set up with the first column header for GL code the Column name is GLCode, and the remaining column headers are department codes (various three digit numbers). I am trying to set up a formula that permits me to dynamically look up values in the various tables.


I have been successful in looking up the two values(GLCode and Dept Code) in a table with the following formula, but I want to be able to change the table name in another cell (in this case, "K27")

This works:
=HLOOKUP(L27, TableFYE_2010[#All],MATCH(M27,TableFYE_2010[[#All],[GLCode]],0),0)


This addition of a reference to a table name in a cell returns an error:
=HLOOKUP(L27, K27[#All],MATCH(M27,K27[[#All],[GLCode]],0),0)

I have been looking into using INDIRECT to reference the table name, and trying the following syntax
=HLOOKUP(L27,INDIRECT(K27&"[#All]&"),MATCH(M27,INDIRECT(K27&"[[#All]&,[GLCode]]&",0),0))

But it returns an error too (although a different one -- invalid cell reference #REF error). Also, I am hoping to find a non-volatile way of doing this.

Ideas?

Thanks!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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