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

Lookup and Reference Examples

  • How to use Excel MMULT Function
  • Excel Advanced Lookup using Index and Match Functions
  • How to get address of last cell in range in Excel
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • How to use Excel ROWS Function

Data Analysis Examples

  • How to add Trendline to a chart in Excel
  • How to conditionally sum numeric data in an Excel table using SUMIFS
  • How to Use Solver Tool in Excel
  • How to create running total in an Excel Table
  • Conditional Formatting Data bars Examples in Excel

Data Validation Examples

  • Excel Data validation date in next 30 days
  • Excel Data validation number multiple 100
  • Excel Data validation whole percentage only
  • Excel Data validation must not contain
  • Excel Data validation with conditional list

Create dynamic workbook reference to another workbook in Excel

by

To build a dynamic worksheet reference – a reference to another workbook that is created with a formula based on variables that may change – you can use a formula based on the INDIRECT function. See example below:

Formula

=INDIRECT("'["&workbook&"]"&sheet&"'!"&ref)

Explanation

In the example shown, the formula in E6 is:

=INDIRECT("'["&B6&"]"&C6&"'!"&D6)

How this formula works

The gist of this formula is to build up a complete reference to a range in another workbook as text, then use the INDIRECT function to convert the text to an actual reference.

Worked Example:   How to reference named range different sheet in Excel

A reference to an external worksheet looks like this:

‘[sample data.xlsx]Sheet1’!A1

Note the square brackets ([ ]) around workbook name, single quotes (‘ ‘) around the worksheet + sheet, and the exclamation mark (!) that follows.

Worked Example:   Lookup with variable sheet name in Excel

To create a reference like this using text, we use concatenation to join values from columns B, C, and D with the required brackets, quotes, and exclamation mark:

=INDIRECT("'["&B6&"]"&C6&"'!"&D6)

The result is fed into INDIRECT as the ref_text:

=INDIRECT("'[sample data.xlsx]Sheet1'!A1")

The INDIRECT function then evaluates the text and converts it to a reference. Excel follows the reference and returns the value at the given reference.

Worked Example:   Basic error trapping example in Excel

Note: if the reference is invalid, or if the workbook referenced is not open, INDIRECT will throw a #REF error. You can catch this error with the IFERROR function and display a custom result if you like.

Post navigation

Previous Post:

How to retrieve workbook name only in Excel

Next Post:

How to create dynamic worksheet reference 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
  • How to count specific words in a cell in Excel
  • How to extract domain from email address in Excel
  • How to add a line break with a formula while joining text strings in Excel
  • Remove text by matching in a cell in Excel
  • How to check if cell contains number in Excel
  • Add years to date in Excel
  • Get project end date in Excel
  • Convert decimal hours to Excel time
  • How to get Holiday Date from Year in Excel
  • Get first Monday before any date in Excel
  • PMT, RATE, NPER, PV and FV Financial Functions in Excel
  • FV function: Description, Usage, Syntax, Examples and Explanation
  • IRR function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate simple interest in Excel
  • ODDLPRICE function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles