View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default INDIRECT function in Office 2007

"T. Valko" wrote...
That's a generic formula that can be entered anywhere.


Yup. That's the point.

The OP didn't say where the formula would be entered. I don't like using
ROW(), COLUMN() or the equivalent "RC". Depending on where the formula is
entered then you might have to calculate an offset.


The horrors!

OK, not as good as R1C1-style, but still more flexible, if you want
cell B1 in the active worksheet to refer to cell B5 in the workbook
named in cell A1 of the active worksheet, then try the following as
the cell B1 formula.

=INDIRECT("'"&$A$1&'!"&CELL("Address",B5))

Then again, if there were only 12 varying worksheets, you could define
the names

JanWS =Jan!$1:$65536
FebWS =Feb!$1:$65536
MarWS =Mar!$1:$65536
AprWS =Apr!$1:$65536
MayWS =May!$1:$65536
JunWS =Jun!$1:$65536
JulWS =Jul!$1:$65536
AugWS =Aug!$1:$65536
SepWS =Sep!$1:$65536
OctWS =Oct!$1:$65536
NovWS =Nov!$1:$65536
DecWS =Dec!$1:$65536

UseWS
=CHOOSE(MATCH($A$1,
{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";" Sep";"Oct";"Nov";"Dec"},
0),
JanWS,FebWS,MarWS,AprWS,MayWS,JunWS,JulWS,AugWS,Se pWS,OctWS,NovWS,DecWS)

Then use formulas like

=INDEX(UseWS,ROWS(...),COLUMNS(...))

to avoid volatile functions entirely. If there'd be a lot of these
formulas, volatile function calls can take quite a toll on recalc
performance.