Summary

To increment a reference created as text inside the INDIRECT function, you can use the CELL function. In the example shown, the formula in D5 is:

=INDIRECT($B$5&"!"&CELL("address",A1))

Which increments as the formula is copied down.

Generic formula

=INDIRECT(sheet&"!"&CELL("address",A1))

Explanation 

Consider a simple dynamic reference to Sheet2 using the INDIRECT in a formula like this:

=INDIRECT($B$5&"!"&"A1")

If we change the sheet name in B5 to another (valid) name, INDIRECT will return a reference to A1 in the new sheet.

However, if we copy this formula down the column, the reference to A1 won't change, because "A1" is hardcoded as text.

To solve this problem, we use the CELL function to generate a text reference from a regular cell reference:

CELL("address",A1)

With "address" as the first argument, and A1 as the second argument, the CELL function returns a string like "$A$1". Because A1 is a regular cell reference, it will increment normally as the formula is copied down the column. The result in D5:D9 is a series of formulas like this:

=INDIRECT("Sheet2!$A$1")
=INDIRECT("Sheet2!$A$2")
=INDIRECT("Sheet2!$A$3")
=INDIRECT("Sheet2!$A$4")
=INDIRECT("Sheet2!$A$5")

In each case, INDIRECT resolves each text string to a reference and Excel returns the value at the given cell in Sheet2.

Note: both INDIRECT and CELL are volatile functions and recalculate with every worksheet change. This can cause performance problems in more complex worksheets.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.