Hi,
I'm looking for an (non-volatile) alternative to the INDIRECT (and OFFSET function). I'm working with a price basis converter for a cash flow model, which converts a cash flow (starting in 2010) from e.g. N to R2017 taking corresponding year, a ccy cross vector (eg. EURUSD) and an inflation vector as input variables.
In the original formula the OFFSET and INDIRECT function is used to select the right [width]" of the inflation vector and ccy cross vector.
....OFFSET(INDIRECT("y_"&$H27);0;1;1;[width])...
Where the ["width"] is dynamic (eg. given by (2017-2010+1) and defined as (MAX(IF($G27="N";K$3;MID($G27;2;4)*1);IF($G28="N";K$3;MID($G28;2;4)*1))-MIN(IF($G27="N";K$3;MID($G27;2;4)*1);IF($G28="N";K$3;MID($G28;2;4)*1))))+1)
Where "y_"&$H27 is a named range of the inflation vector and $G27 $G28 are input cells
So far i'm trying to replace this by the INDEX function. Since the INDEX function doesn't have a [width] input, the reference range has to be changed dynamically. This could be done by using the ADDRESS function to define a range of the inflation vector, but hence it cannot be read by the INDEX formular without using INDIRECT..:
...INDEX(INDIRECT(INDEX(ADDRESS(MATCH("y_"&$H39;$H$1:$H$23;0);COLUMN(K$33))&":"&ADDRESS(MATCH("y_"&$H39;$H$1:$H$23;0);COLUMN(K$33)+(MID($G$33;2;4)-K$3-1));;));;)
So does anyone know an alternative to the INDIRECT function, so that I can define a dynamic range as reference in the INDEX formula.??
Such as..:
...INDEX(INDEX(ADDRESS(MATCH("y_"&$H39;$H$1:$H$23;0);COLUMN(K$33))&":"&ADDRESS(MATCH("y_"&$H39;$H$1:$H$23;0);COLUMN(K$33)+(MID($G$33;2;4)-K$3-1);;));;)...
The function has to be dynamic to respond to user-changes of the input variable - hence hardcoded values will not work...
Thank you!
Bookmarks