Hello! I'm writing a time-based model in Excel, with variables set up as columns, and would like to calculate output based on the values of in previous timestep (with rows representing timesteps). if I have variables setup as named ranges, is there a very slick way to refer to the previous row of a named range, either from within the range, or in a different range?
The solution I've come up with:
Naming a new range that refers to a helper column where every cell is set equal to the value of the cell in the previous row of the important variable column/range. I name the new range "VARRR_Prev" if the important variable/range is named "VARRR." This method works but requires a bit of construction to repeat for all important variables.
Other possibilities I've come across:
using index and match somehow - I can see this working, but it's a bit kludgy
offset - volatility of command would make the workbook sloooow
a relatively-referenced named range - this was very promising, but I can't get it to work across different sheets. Being able to name a relative range "Prior" and have it refer to the prior row, and then unioning the row-range "Prior" with the column-range "VARRR" is very, very slick. But, again, I haven't gotten it to work across sheets.
So if anyone out there has ideas, let me know, and thanks!
The solution I've come up with:
Naming a new range that refers to a helper column where every cell is set equal to the value of the cell in the previous row of the important variable column/range. I name the new range "VARRR_Prev" if the important variable/range is named "VARRR." This method works but requires a bit of construction to repeat for all important variables.
Other possibilities I've come across:
using index and match somehow - I can see this working, but it's a bit kludgy
offset - volatility of command would make the workbook sloooow
a relatively-referenced named range - this was very promising, but I can't get it to work across different sheets. Being able to name a relative range "Prior" and have it refer to the prior row, and then unioning the row-range "Prior" with the column-range "VARRR" is very, very slick. But, again, I haven't gotten it to work across sheets.
So if anyone out there has ideas, let me know, and thanks!