I am struggling to deduce a way to make dynamic INDIRECT references to cell ranges on other worksheets. Would appreciate any suggestions, details are:
The workbook includes 4 worksheets (Product1, Product2, Product3, Warehouses). The Warehouses sheet contains the following formula to populate an inventory list for each warehouse from the three product worksheets (derived from http://exceltactics.com/make-filtered-list-sub-arrays-excel-using-small/). This is the formula in cell B3:
=IFERROR(INDEX(INDIRECT(B$2&"!B$3:B$400"),SMALL(IF(INDIRECT(B$2&"!$C$3:$C$400")=$B$1,ROW(INDIRECT(B$2&"!B$3:B$400"))-ROW(INDIRECT(B$2&"!B$3"))+1),ROWS(Product1!$B$3:$B3))),"")
Where:
Warehouses-->$B$1 = Warehouse1 or Warehouse2
Warehouses-->B2, C2, D2 = Column headers for Product1, Product2, Product3
Product Sheets-->Column B = Serial #
Product Sheets-->Column C = Location (Warehouse1, Warehouse2)
Currently, I have to amend the last part of the formula for each row: ROWS(Product1!$B$3:$B3)
, ROWS(Product2!$B$3:$B3)
, ROWS(Product3!$B$3:$B3)
.I am trying to dynamically link it to the column header like the other parts of the code (e.g. ROW(INDIRECT(B$2&"!B$3:B$400"))
. I'm stuck though because the range $B3
has to change with each row, whereas the others are static and are fine enclosed in the quotations.
This effort is important because I want less capable users to be able to copy the formula to new columns without having to amend it. Appreciate any thoughts on this!