3
votes

Here's my desired outcome: I want an Excel workbook (say Master.xls) that I can drop into a directory of other Excel workbooks and Master.xls will extract a given range of cells from all of the hundreds of other workbooks in that directory. I have multiple directories with hundreds of Excel files in each, so I need a Master.xls file that will easily move between directories with different file paths and update based on the files around it in the directory. In my Master.xls file, I can build the file names for all of these other workbooks using text functions like CONCATENATE.

The problem comes when I try to use Excel to reference cells in workbooks that are not currently open. The problems:

  1. INDEX can access closed workbooks using hard-coded paths, but can't (as far as I can tell) accept cell ranges as text. To enter cell ranges as text to other functions, one has to use the...
  2. INDIRECT function, which doesn't work for closed workbooks.

Basically, INDEX can solve my problem but I can't figure out how to get it to work without hard-coding the paths to the closed workbook into the function call. That's a deal breaker, since I have thousands of workbooks to reference and doing a find-replace to change the file path for each workbook is time-prohibitive and not maintainable.

Other constraints: no Excel add-ins since this sheet has to be shared with others and no VBA because this has to be used by people with fear of macros. I recognize that Excel is not the right tool for this job. Believe me, if I could use another tool, I would.

Update: sample Excel sheet showing the problem:

Excel output

1
good description of the problem. It may be helpful to show an example formula or two where you have done the index and indirect methods. Someone may identify a typo or an alternate arrangement of your formula. - Forward Ed
Thanks @ForwardEd. I've added a sample image to the original post. - Adrian Down
Try placing ' before the C in B1 unless that was a typo from edits. Looks like you are missing the opening ' to enclose your path, workbook name and sheet' - Forward Ed
Thanks again @ForwardEd. That's just a typo in the edits (trying to get Excel to display text). B1 has a ' character before it that Excel is not displaying. Adding another doesn't change the results. The INDEX formulas still fail. - Adrian Down

1 Answers

3
votes

Going straight to the source at MS Office support, INDIRECT does not work with external workbooks.

Snippet of MS Support for INDIRECT