I would like to know how to update the named ranges for Excel model variables based on user decisions. I want to let the users choose how long the simulation will run for (between 5 to 10 years/time steps) and need to display a target value on some line charts that spans the entire duration of the game.
To do this, I’ve created a model variable (NumYears) which is a single cell that can be set by the user.
Based on this value, the ‘Time’ model variable’s named range will change dynamically. (0 to NumYears years)
I’m able to update the ‘Time’ variable’s named range based on the value of ‘NumYears’ using either the OFFSET or INDEX excel functions in the name definitions.
This works as expected if I directly set the value of ‘NumYears’ in the excel sheet, but doesn’t work if the value of ‘NumYears’ is set by the user through the simulation interface.
Is there any way I can make this work?
Regards, Tim