View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default can this be done faster?

I will (for the example) assume data is in A2:B1000
In F1:F19 put the years (1998, 1999 ...)
In E2:E13 put month numbers (1,2,3 ... 12)
In F2 enter
=STDEV(IF((MONTH(A2:A1000)=$E2)*(YEAR(A2:A1000)=F$ 1),($B$2:$B$1000))) and
complete it with CTRL+SHIFT+ENTER not just ENTER because it is an array
formula - Excel will enclose the formula in curly braces {} Pay close
attention to the location of the $ symbols - to make absolute references to
rows and columns.
Copy the formula down and across the table
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"frank" wrote in message
...
Hi my question is simple and I do know a very slow and tedious way of
doing
it. Anybody can offer me any advice to do it in a faster way? Here is my
data
series.

I have an index daily closing price for 19 years.

Date Price
1/1/1998 20.30
1/2/1998 20.80
1//3/1998 20.45
****** ****
1/31/1998 23.98
2/1/1998 26.00
****** ****
9/31/2006 120.60

I want to compute monthly volatility (standard deviation) using daily
return. So for each month, I will use stdev function and select the
corresponding daily return (ranges from 20-25 data points depending on how
many trading days in that specific month). I need to do stdev functions
for
200+ times to complete this exercise. Any one know any better way to do
this?