Thread: losing streak
View Single Post
  #12  
Old 22nd April 2006, 07:02 PM
marcus25 marcus25 is offline
Member
 
Join Date: Dec 2004
Posts: 172
Default Losing runs

If you only want to find out how many losing runs you have for a certain win percentage here is a rough and ready code snippet you can put into a dummy macro.
'----------------------------------
Dim x, y, z As Single

z = (100 - ActiveCell.Value) / 100

If ActiveCell.Value <> "" Then

For y = 1 To 100
If x <= 0.992 Then
x = 1 - (z ^ y)
Else: Exit For
End If
'Debug.Print x
Next
ActiveCell.FormulaR1C1 = y
Else: MsgBox "Type in losing %!"
End If
'---------------------------
I put in (0.992) 99.2 % is close enough for accuracy, you can change it.
Once you created the macro just type in a WINNING percentage number into a cell and run the macro. Note! keep that cell as active!!! The number of outs will replace the percentage in the cell.
I know little about Excel, but can guarantee that this code will work.
Most of you can make a better macro out of it than I ever could.
Good luck with it.
Reply With Quote