Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Get column index in Excel Table
  • How To Remove Duplicates In Excel Column Or Row?
  • Everything about Charts in Excel
  • How To Insert and Customize Sparklines in Excel
  • Randomize/ Shuffle List in Excel

References

  • How to get last column number in range in Excel
  • How to get last row in text data in Excel
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to get first row number in range in Excel
  • Create hyperlink with VLOOKUP in Excel

Data Validations

  • Excel Data validation date in next 30 days
  • Excel Data validation exists in list
  • Excel Data validation allow weekday only
  • Excel Data validation must not contain
  • Excel Data validation only dates between

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:   Save As in Excel Explained

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:   3D SUMIF for multiple worksheets 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:   Get work hours between dates custom schedule 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 count line breaks in cell in Excel worksheet

Next Post:

How to count total words in a cell 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

Logical Functions

  • OR function Examples in Excel
  • OR function: Description, Usage, Syntax, Examples and Explanation
  • IF, AND, OR and NOT Functions Examples in Excel
  • Invoice status with nested if in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • How to get Weekdays, Working days between Two Dates in Excel
  • Get day name from date in Excel
  • Calculate number of hours between two times in Excel
  • Display the current date and time in Excel
  • Excel Date & Time Functions Example

Grouping

  • Categorize text with keywords in Excel
  • Running count group by n size in Excel
  • Group numbers with VLOOKUP in Excel
  • Group times into unequal buckets in Excel
  • If cell contains one of many things in Excel

General

  • Count cells that do not contain errors in Excel
  • Lock Cells in a Worksheet Excel
  • Check if range contains a value not in another range in Excel
  • How to get random value from list or table in Excel
  • How to calculate percent variance in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning