Shawn
let the
sheet calculate how many more places I'd pay,
That's easy - the number of entries divided by 4, right?
and distribute the remaining
amount among those places.
Distribute how? If you have 40 entries, you will pay 10 places. If each
entry is $10 and you will pay $100 to the winner, then you have $300 for 9
places. Surely that won't be distributed evenly. One way to do it would be
to use the sum-of-the-years-digits like they did for depreciation in the old
days. Here's an example
Function Payout(ENumb As Long, EPrice As Double, _
WinPay As Double, Place As Long) As Double
Dim TotalPot As Double
Dim TotalPlaces As Long
Dim SOYD As Long
Dim i As Long
TotalPot = (ENumb * EPrice) - WinPay
'\ = integer division
TotalPlaces = (ENumb \ 4)
SOYD = 0
For i = 2 To TotalPlaces
SOYD = SOYD + i
Next i
If Place <= 1 Or Place TotalPlaces Then
Payout = CVErr(xlErrValue)
Else
Payout = TotalPot * ((TotalPlaces - Place + 2) / SOYD)
End If
End Function
Enumb = number of entries
EPrice = cost per entry
winpay = amount paid to first place
Place = Place you want to compute
--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.