I need to use a dynamic reference to table names in a formula.
I have a worksheet with multiple tables each containing multiple columns and rows. The tables have the defined names ‘plan1’ and ‘plan2’ sequentially.
I have another named table, lstPlans, with top-level information about each of the detailed plans (i.e., tables plan1, . . . plani). In lstPlans, I need a column with a formula that is the SUMPRODUCT of 2 columns in a corresponding plan. So for the first plan in lstPlan, the formula is =SUMPRODUCT(plan1[ColX],plan1[ColY]).
I’d like to write a relative formula so I can take advantage of table properties for lstPlans. That means then that I can’t directly refer to “plan1” since the 2nd entry in lstPlans needs to refer to table “plan2”, the 3rd to “plan3,” etc., so I need to use a formula to concatenate the text “plan” with a number that corresponds to the position number of the summary data in lstPlans. I can do that using “Concatenate” function and “Row” functions in lstPlans. But, I haven’t yet been able to use that result in a relative reference to the table name successfully.
How would I structure something, for example, like =SUMPRODUCT(“relativereference to table here”[ColX],”relativereference to table here”[ColY]). Any suggestions for how to structure that reference??
I have a worksheet with multiple tables each containing multiple columns and rows. The tables have the defined names ‘plan1’ and ‘plan2’ sequentially.
I have another named table, lstPlans, with top-level information about each of the detailed plans (i.e., tables plan1, . . . plani). In lstPlans, I need a column with a formula that is the SUMPRODUCT of 2 columns in a corresponding plan. So for the first plan in lstPlan, the formula is =SUMPRODUCT(plan1[ColX],plan1[ColY]).
I’d like to write a relative formula so I can take advantage of table properties for lstPlans. That means then that I can’t directly refer to “plan1” since the 2nd entry in lstPlans needs to refer to table “plan2”, the 3rd to “plan3,” etc., so I need to use a formula to concatenate the text “plan” with a number that corresponds to the position number of the summary data in lstPlans. I can do that using “Concatenate” function and “Row” functions in lstPlans. But, I haven’t yet been able to use that result in a relative reference to the table name successfully.
How would I structure something, for example, like =SUMPRODUCT(“relativereference to table here”[ColX],”relativereference to table here”[ColY]). Any suggestions for how to structure that reference??