Excel advanced

How to Reference a Different Worksheet Dynamically in Excel?

Using the INDIRECT function, you can easily reference different worksheets by changing a cell value, making your formulas more flexible.

Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.

The formula

Prompt

"Reference a different worksheet dynamically by using a cell that contains the sheet name, so the formula updates when you change the name"

Excel
=INDIRECT(A1 & "!B2")

This formula dynamically references a cell in a worksheet specified by the name in cell A1.

Step-by-step breakdown

  1. A1 contains the name of the worksheet you want to reference.
  2. The ampersand (&) concatenates the worksheet name with the cell reference.
  3. "!B2" specifies the cell in the referenced worksheet.
  4. INDIRECT evaluates the concatenated string as a reference to return the value.

Edge cases & warnings

  • If the sheet name in A1 is misspelled, the formula will return a #REF! error.
  • If the referenced sheet is deleted, the formula will also return a #REF! error.
  • Using INDIRECT with closed workbooks will not work; the referenced workbook must be open.

Examples

Prompt

"A1 contains 'Sheet2'; B2 in 'Sheet2' is 100"

Excel
100
Prompt

"A1 contains 'Sheet3'; B2 in 'Sheet3' is 'Hello'"

Excel
'Hello'

Frequently asked questions

Can I use INDIRECT with closed workbooks?

No, INDIRECT only works with open workbooks.

What happens if the sheet name contains spaces?

You need to enclose the sheet name in single quotes, like this: 'Sheet Name'.

Is INDIRECT a volatile function?

Yes, INDIRECT is volatile and recalculates whenever any change is made in the workbook.

Can't find what you need?

Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.