Forum Discussion
jamesbeale
Mar 14, 2021Copper Contributor
Using Name Variable within External Workbook Lookup Path
Hi all, I have a lookup to an eternal workbook currently taking place using the following formula: =SUM('C:\Users\james\OneDrive\Documents\Work\Financial\Sales Figures\2019\[James.xls]Summary'!$...
HansVogelaar
Mar 14, 2021MVP
jamesbeale You can use the INDIRECT function, but (and this is a big BUT!), this function only works with references to another workbook if that workbook is open in Excel. Otherwise, INDIRECT will return #REF!
The formula would be
=SUM(INDIRECT("'C:\Users\james\OneDrive\Documents\Work\Financial\Sales Figures\" & CurrentYear & "\[James.xls]Summary'!$F$7:$F$18"))
chahine
Mar 15, 2021Iron Contributor
only way is to use indirect as sum will not understand address c:\etc
- jamesbealeMar 15, 2021Copper Contributor
- chahineMar 15, 2021Iron Contributorok , see =SUM("'"&"C:\Users\james\OneDrive\Documents\Work\Financial\Sales Figures\"&indirect(CurrentYear)&"\[James.xls]Summary'!"$F$7:$F$18)
i think now it should work - HansVogelaarMar 15, 2021MVP
It looks OK to me. I'm afraid I'm out of ideas...