Hi. I'd appreciate if someone can shed some light if there is a way to replace INDIRECT in this example below.
I have a "source workbook" of raw data, with about 20 sheets, each one containing about 10-30 columns and several thousands rows. Columns captions (always in row 1) are standardized, but they are not ordered in the same order in all sheets, and not all the sheets contain all the columns. This is example of sheet "src1" in source workbook:
\1
I have another, "my workbook", to process these data. I want to extract data from one sheet of "source workbook" at a time, so I specify the desired sheet in "my workbook", cell A2 in this example. It looks up for the data by caption and, in this example, by Order ID, which is specified in column C of "my workbook".
\1
Formula in D2 is:
=IFERROR(INDEX(INDIRECT("[source.xlsx]"&$A$2&"!$A$1:$G$160"),MATCH($C2,INDIRECT("source.xlsx]"&$A$2&"!$A$1:$a$160"),0),MATCH(D$1,INDIRECT("[source.xlsx]"&$A$2&"!$A$1:$G$1"),0)),"n/a")
This formula looks up for Order # in sheet "src1" of source workbook (specified here in cell A2), and returns value from appropriate column; if there is no such a column on that sheet ("Approval time" in this example), it returns "n/a". So it works fine, but I kind of don't like this part
INDIRECT("[source.xlsx]"&$A$2&"!$A$1:$G$160")
and other two occurences of this function.
Is there a way to replace it with some other, simplier and possibly faster function, to reference sheet in "source workbook" specified in cell A2 of "my workbook", second screenshot above? It works acceptably fast, say about 1 second to process all the data when I change sheet or some other input, on a new computer, but at my older laptop at home, it takes as much as 7-8 seconds, and I guess it might be because of INDIRECT.
Bookmarks