Greetings,
I am attempting to develop both year to date and 1 year rolling Standard Deviation for a set of data recorded monthly across several years which would be based around a date reference point input by the user.
Ex. Stock Returns on a monthly basis for two different companies.
1 A B C D O
2 ... 12/31/03 1/31/04 2/28/04 .. 1/31/05
3Company A 3.2% 1.5% -0.55% .. 1.7%
4Company B -1.52% 5.2% 2.3% .. 3.1%
So, on the control panel worksheet, if a user were to input "1/31/05" for the date, the sheet would compute a year to date standard deviation which in this case would just be =stdev(O3:O3), whereas if the user entered "2/28/04" the year to date would be something akin to =stdev(C33).
The same would apply for a rolling 1 year standard deviation, if a user entered say 1/31/05 on the control panel worksheet, it would calculate =stdev(D3:03).
For the dynamic year to date calculation (the smaller priority, as it is potentially more difficult) I am really uncertain as to how I would handle it formula wise.
For the 1 year rolling standard deviation I have been playing with using OFFSET and HLOOKUP, doing something along the lines of (this doesn't work)
Unfortunately, the HLOOKUP, based on the user input date, returns the VALUE of the field I want to use as my reference point in OFFSET, where I need to feed the offset formula with the CELL REFERENCE of the value the HLOOKUP returns.
Hopefully the above makes light of what I am trying to achieve, I'll gladly provide more information upon request.
Thanks kindly,
Jeff
I am attempting to develop both year to date and 1 year rolling Standard Deviation for a set of data recorded monthly across several years which would be based around a date reference point input by the user.
Ex. Stock Returns on a monthly basis for two different companies.
1 A B C D O
2 ... 12/31/03 1/31/04 2/28/04 .. 1/31/05
3Company A 3.2% 1.5% -0.55% .. 1.7%
4Company B -1.52% 5.2% 2.3% .. 3.1%
So, on the control panel worksheet, if a user were to input "1/31/05" for the date, the sheet would compute a year to date standard deviation which in this case would just be =stdev(O3:O3), whereas if the user entered "2/28/04" the year to date would be something akin to =stdev(C33).
The same would apply for a rolling 1 year standard deviation, if a user entered say 1/31/05 on the control panel worksheet, it would calculate =stdev(D3:03).
For the dynamic year to date calculation (the smaller priority, as it is potentially more difficult) I am really uncertain as to how I would handle it formula wise.
For the 1 year rolling standard deviation I have been playing with using OFFSET and HLOOKUP, doing something along the lines of (this doesn't work)
Code:
=OFFSET(HLOOKUP(), 0, 0, 1, -11)
Unfortunately, the HLOOKUP, based on the user input date, returns the VALUE of the field I want to use as my reference point in OFFSET, where I need to feed the offset formula with the CELL REFERENCE of the value the HLOOKUP returns.
Hopefully the above makes light of what I am trying to achieve, I'll gladly provide more information upon request.
Thanks kindly,
Jeff