Dynamically reference a Named Table Column via cell content in Excel
Posted
by
rcphq
on Super User
See other posts from Super User
or by rcphq
Published on 2012-08-13T14:46:33Z
Indexed on
2013/06/30
22:23 UTC
Read the original article
Hit count: 303
microsoft-excel
|microsoft-excel-2007
How do I reference an Excel Table column dynamically in Excel 2007? ie: i wanna reference a named column of a named table and what table it is will vary with the value of a cell.
I have a Table in Excel (Let's call it Table1). I want to reference one of its columns (Let's call it column1) dynamically from a value in another cell (A1) so that I can achieve the following result:
When I change A1, the formula that counts Table1[DynamicallyReferencedColumnName] gets updated to the new reference.
I tried using =Count(Table1[INDIRECT("$A$1")])
but Excel says the formula contains an error.
Example:
A1 = names then the formula would equal Count(Table1[names]).
A1 = lastname then the formula would equal Count(Table1[lastname]).
© Super User or respective owner