Classic Excel thinking! You could save yourself some headaches and re-model your data:
YEAR SMR SMR_U SMR_O ERW D
In this way your data goes down the page, and calculations and such like are simplified down to their base coding, for example:
if d_{i} >0 & erw_{i} >0 then smr_u{i} = (d_{i}*((1-(1/(9*d_{i}))-(1.959963985/(3*sqrt(d_{i})))))**3)/erw_{i};
To:
if d > 0 and erw > 0 then smr_u=(d*((1-(1/(9*d))-(1.959963985/(3*sqrt(d)))))**3)/erw;
Another benefit to this setup is that it does not matter how many years there are, if the number expands to 50 or 100 years the code remains untouched, in your example however the code expands rapidly.
... View more