Const Bins = 10 Function PntsWon(RC As Double, PlayerOuts As Double, TeamOuts As Double, RpOAvg As Double) As Double Dim RunswPlayer, RunsOpp, RunningTotal As Double Dim i, j As Integer Dim TempWLPct186, TempPrPost, TempWtPrPost, RpOStd As Double RpOStd = -0.004 + RpOAvg * 0.15098 RunningTotal = 0 For j = 1 To Bins For i = 1 To Bins RunswPlayer = RC + (TeamOuts - PlayerOuts) * (RpOAvg + RpOStd * Application.NormSInv((i - 0.5) / Bins)) RunsOpp = TeamOuts * (RpOAvg + RpOStd * Application.NormSInv((j - 0.5) / Bins)) If RunswPlayer < RunsOpp Then TempWLPct186 = 0 Else TempWLPct186 = WLPct186(RunswPlayer, RunsOpp) End If TempPrPost = PrPost(TempWLPct186) TempWtPrPost = TempPrPost / (Bins ^ 2) RunningTotal = RunningTotal + TempWtPrPost Next i Next j PntsWon = RunningTotal End Function Function WLPct186(RS, RA) As Double If RS = 0 Then WLPct186 = 0 Exit Function End If WLPct186 = (RS ^ 1.86) / (RS ^ 1.86 + RA ^ 1.86) End Function Function PrPost(WLPct186) As Double If WLPct186 < 0.5 Then PrPost = 0 Exit Function ElseIf WLPct186 > 0.6875 Then PrPost = 1 Exit Function Else: PrPost = 44.596 - 235.68 * WLPct186 + 406.18 * (WLPct186 ^ 2) - 226.35 * (WLPct186 ^ 3) End If End Function