In the absence of other replies, (edit:and there were none when I looked 25 mins. ago!) while you probably can do this without macros I wouldn't relish creating or amending 2 or 3 of them.
The max drawdown, is easy, you've used
=SMALL($B$2:B1560,1)
but this seems to work too:
=MIN(B2:B1356)
For days in current DD you could try:
=IF(B2<0,MIN(IF(B2:B1356>=0,ROW(B2:B1356)))-2,"Not currently in drawdown")
but this is ARRAY ENTERED, and the -2 in the formula means it expects the first value to be in row 2.
However I have done a macro which is a function you can use on a worksheet. I hesitated to suggest it because I was just exploring different ways of doing things for myself.
This is how the formulae would look on a worksheet:
=mystats($B$2:$B$1356,"maxdd")
=mystats($B$2:$B$1356,"daysinmaxdd")
=mystats($B$2:$B$1356,"daysincurrentdd")
=mystats($B$2:$B$1356,"longestddperiod")
=mystats(B13:B1367,"xxxx")
(I've included the last one to show what happens when you enter the 2nd argument wrongly - it shows the valid possibilities with a message:
Incorrect 2nd argument? Should be one of: MAXDD, DAYSINMAXDD, DAYSINCURRENTDD, LONGESTDDPERIOD
In fact you can include spaces and/or vary the case. eg:
=mystats($B$2:$B$1356,"Days in Current DD")
will work.
Finally, here's the function
[vba]Function MyStats(therange, whichStat)
MAXDD = Application.Min(therange.Value)
LongestDDLength = 0
MaxDDLength = 0
LatestDDLength = 0
CurrentDDPeriodIsMaxDDPeriod = False
IsLatestDDPeriod = True
For Each cll In therange
If cll.Value < 0 Then
If cll.Value = MAXDD Then CurrentDDPeriodIsMaxDDPeriod = True
ThisPeriod = ThisPeriod + 1
If LongestDDLength < ThisPeriod Then LongestDDLength = ThisPeriod
If IsLatestDDPeriod Then LatestDDLength = ThisPeriod
Else
If CurrentDDPeriodIsMaxDDPeriod Then MaxDDLength = ThisPeriod
ThisPeriod = 0
CurrentDDPeriodIsMaxDDPeriod = False
IsLatestDDPeriod = False
End If
Next cll
Select Case UCase(Replace(whichStat, " ", ""))
Case "MAXDD": MyStats = MAXDD
Case "DAYSINMAXDD": MyStats = MaxDDLength
Case "DAYSINCURRENTDD": If therange.Cells(1).Value < 0 Then MyStats = LatestDDLength Else MyStats = "Not currently in drawdown"
Case "LONGESTDDPERIOD": MyStats = LongestDDLength
Case Else: MyStats = "Incorrect 2nd argument? Should be one of: MAXDD, DAYSINMAXDD, DAYSINCURRENTDD, LONGESTDDPERIOD"
End Select
End Function[/vba]