Strings in formulas for cell references

Peteor

Board Regular
Joined
Mar 16, 2018
Messages
114
I am trying to make the following work in Excel, not VBA.

=INDEX('[&A2&.xlsm]&B2&'!$B:$G,5,1)

I know I am missing string quotations, but am unsure what else is missing. Does anyone have any input here?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,101
Office Version
365
Platform
Windows
You need to use INDIRECT to do that.
 

Peteor

Board Regular
Joined
Mar 16, 2018
Messages
114
I am a bit confused on the usage of this function. I see the Indirect function is used to return a valid cell reference from a text string. I attempted to no avail:

=INDEX('[Indirect(A2).xlsm]Indirect(B2)'!$B:$G,5,1)

What would you change here?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,101
Office Version
365
Platform
Windows
Try
=INDEX(INDIRECT("'["&A2&".xlsm]"&B2&"'!$B:$G"),5,1)
 

Forum statistics

Threads
1,077,617
Messages
5,335,260
Members
399,009
Latest member
twcaddell

Some videos you may like

This Week's Hot Topics

Top