Can someone please help me translate the formula:
{=(SUMSQ(IF(C3:C14-G2>0,0,C3:C14-G2))/COUNT(C3:C14))^(1/2)}
into a VBA user defined function? So far, I have:
(where C3:C14 is the MonthRet and G2 is the MAR in the above formula)
I know it's not much, but I'd really appreciate any help.
Thanks!
tom
{=(SUMSQ(IF(C3:C14-G2>0,0,C3:C14-G2))/COUNT(C3:C14))^(1/2)}
into a VBA user defined function? So far, I have:
(where C3:C14 is the MonthRet and G2 is the MAR in the above formula)
Code:
Function DownsideDev(MonthRet As Range, MAR As Double) As Double
' Calculates Downside Deviation below a Minimum Acceptable Return.
' {=(SUMSQ(IF(C3:C14-G2>0,0,C3:C14-G2))/COUNT(C3:C14))^(1/2)}
Dim i As Integer
Dim DownsidePerf As Double
For i = 1 To MonthRet.Count
Next i
End Function
I know it's not much, but I'd really appreciate any help.
Thanks!
tom