Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Two-column Lookup in Excel
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • Perform case-sensitive Lookup in Excel
  • How to use Excel ROWS Function
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation

Data Analysis Examples

  • How To Create Pareto Chart in Excel
  • Get column name from index in Excel Table
  • How To Sort One Column or Multiple Columns in Excel
  • How to add Trendline to a chart in Excel
  • Excel Pie Chart

Data Validation Examples

  • Excel Data validation require unique number
  • Excel Data validation exists in list
  • Excel Data validation date in specific year
  • Data validation must not exist in list
  • Excel Data validation must contain specific text

How to create dynamic reference table name in Excel

by

To build a formula with a dynamic reference to an Excel Table name, you can use the INDIRECT function with concatenation as needed.

Formula

=SUM(INDIRECT(table&"[column]"))

Note: INDIRECT is a volatile function and can cause performance issues in larger, more complex workbooks.

Explanation

In the example shown, the formula in L5 is:

Worked Example:   Excel Data validation don't exceed total
=SUM(INDIRECT(K5&"[Amount]"))

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.

Worked Example:   Count and Sum Functions in Excel

The trick is the INDIRECT function to evaluate the reference.

Worked Example:   Calculate Weighted Average in Excel

We start with:

=SUM(INDIRECT(K5&"[Amount]"))

which becomes:

=SUM(INDIRECT("West"&"[Amount]"))

and then:

=SUM(INDIRECT("West[Amount]"))

The INDIRECT function then resolves the text string into a proper structured reference:

=SUM(West[Amount])

And the SUM function returns the final result, 27,500 for the West region.

Post navigation

Previous Post:

Calculate Conditional Percentile ‘IF’ in table in Excel

Next Post:

How to count table rows in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • REPLACE, REPLACEB functions: Description, Usage, Syntax, Examples and Explanation
  • Get last name from name with comma — Manipulating NAMES in Excel
  • How to get last line in cell in Excel
  • Extract middle name from full name — Manipulating NAMES in Excel
  • How to remove trailing slash from url in Excel
  • NETWORKDAYS.INTL function: Description, Usage, Syntax, Examples and Explanation
  • Pad week numbers with zeros in Excel
  • WORKDAY.INTL function: Description, Usage, Syntax, Examples and Explanation
  • Convert decimal hours to Excel time
  • How to get Holiday Date from Year in Excel
  • DURATION function: Description, Usage, Syntax, Examples and Explanation
  • Compound Annual Growth Rate CAGR formula examples in Excel
  • DDB function: Description, Usage, Syntax, Examples and Explanation
  • Calculate cumulative loan interest in Excel
  • TBILLPRICE function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles