File name in a formula.

Occasional Visitor

Is there a way to refer to an Excel file in a formula by using the content of a specific cell ?

JMW89_0-1635268949651.png

In the cell G48, I'm entering manually the file name but I would like to take the content of the cell A48 to compose the file name.

 

Any advice ? Thalns,

2 Replies

@JMW89 

It could be

=INDIRECT("'c:\gsa..[" & A48 & "]fiche'!$B$7")

@JMW89 

You can use the INDIRECT function for this, but it will only work if the other workbook is open in Excel. INDIRECT does not work with closed workbooks.

The formula would look like this:

=INDIRECT("'["&A48&".xlsx]Fiche'!B7")

Note that the path is not mentioned in the formula since the other workbook must be open.