Excel (2016). Suppose I have some piece of Excel in AnalysisSheet that analyzes data in some other data sheet. And suppose the following:
There are actually several such data sheets. For example, they might be named MayData, JunData, JulData, and so on.
All data sheets are identical in format; only their data are different. For example, they might be the same financial report run in different months
AnalysisSheet only ever looks at ONE of the data sheets at a time. At any given "point of use", it's analyzing EITHER MayData, OR JunData, OR JulData. etc.
The data sheets may be in the same workbook as AnalysisSheet, or they could be in a single different other workbook, or they could be spread across a number of other workbooks, or a combination of those
I need the analysis to run today, and not cause me to want to throw rocks at my computer (see below where I describe how I currently do this)
QUESTION: In pure Excel (i.e. no VB, and no third-party add-ons), How do I minimize the work needed to allow the user of SheetAnalyze to change which of the data sheets' data is being taken from?
How I Currently Do It
I use INDIRECT() to dynamically construct the references to the required data sheet. So for example, in AnalysisSheet I may have the following:
B1 = "MayData" (i.e. the name of the sheet containing the data)
B2 = "MayReport.xlsx" (i.e. the name of the workbook containing the data sheet; this is left blank if the data sheet is in the same workbook as AnalysisSheet)
B3 = "C23" (for example; i.e. the name of some cell of interest in the data sheet)
And then I'd have something like this in B4:
B4 = CONCATENATE("'", IF(ISBLANK(B2),"",CONCATENATE("[",B2,"]")),B1,"'!",B3)
That last produces, in this example, the string: '[MayReport.xlsx]MayData'!C23
I can then use that in INDIRECT() for the analysis proper. So to look at that specific cell I could have;
B5=INDIRECT(B4) (see note**)
which is immune to changes in the name of the data sheet, or its workbook (or even, for that matter, the name of that cell of interest, although granted in this example I've said that data sheets are all identical in format).
All I have to do to change which data is being looked at is change cells B1 and B2. And if I'm careful about things, I could reduce it to changing only the month name (in this example) and then construct even what's in B1 and B2 fro that.
THE PROBLEM IS that INDIRECT() is volatile! As a result, when the data set is large, and maybe there are lots of similar things going on, performance gets hammered. Worst case, I've found myself having to wait minutes for a single change to a single cell in AnalysisSheet, while Excel goes over every single INDIRECT() and re-runs it. Down in the status area at the bottom right of my sheet, I can see the CPU usage going crazy on all nodes.
I'd appreciate any ideas.
** Of course typically I'd not just go for a single cell. Instead I'd pull one or more entire tables from the target data sheet into a sheet or sheets in the same workbook as AnalysisSheet. From there, everything else can use references to that local version of the data.