How to create dynamic reference table name in Excel
To build a formula with a dynamic reference to an Excel Table name, you can use the INDIRECT function with concatenation as needed.
Note: INDIRECT is a volatile function and can cause performance issues in larger, more complex workbooks.
In the example shown, the formula in L5 is:
Which returns the SUM of Amounts for three tables named “West”, “Central”, and “East”.
How this formula works
This formula behaves like these simpler formulas:
=SUM(West[Amount]) =SUM(Central[Amount]) =SUM(East[Amount])
However, instead of hardcoding the table into each SUM formula, the table names are listed in column K, and the formulas in column L use concatenation to assemble a reference to each table. This allows the same formula to be used in L5:L7.
The trick is the INDIRECT function to evaluate the reference.
We start with:
The INDIRECT function then resolves the text string into a proper structured reference:
And the SUM function returns the final result, 27,500 for the West region.