I have these functions that I have created. After searching here and there for ways to accomplish what I want I have not found any solution. So it's up to MrExcels forum to the rescue
I want to have SECONDPRIZE and THIRDPRIZE functions to round down to the nearest half dollar ($.50). i.e. $12.45 becomes $12.00, $12.62 becomes $12.50 and $133.32 becomes $133.00.
Here is the code that have started and accomplished so far for the functions. Any ideas or help on this would be appreciated!
I want to have SECONDPRIZE and THIRDPRIZE functions to round down to the nearest half dollar ($.50). i.e. $12.45 becomes $12.00, $12.62 becomes $12.50 and $133.32 becomes $133.00.
Here is the code that have started and accomplished so far for the functions. Any ideas or help on this would be appreciated!
Code:
Function PRIZEPOOL(curSales As Currency)
'calc the prize pool for the total sales at 50%
PRIZEPOOL = curSales * 0.5
End Function
Function JACKPOT(curPrizePool As Currency, numWinners As Integer)
'calculate the jackpot prize amount at 62% of prize pool
If numWinners < 1 Then
Exit Function
Else
JACKPOT = (curPrizePool * 0.62) / numWinners
End If
End Function
Function SECONDPRIZE(curPrizePool As Currency, numWinners As Integer, numJackPotWin As Integer)
'calculate the second prize amount at 10% with a
'cap of $555 if no jackpot winner and/or rounded down to nearest $.50
If numJackPotWin > 0 Then
SECONDPRIZE = Round(((curPrizePool * 0.1) / numWinners) * 2, 0) / 2
Exit Function
Else
SECONDPRIZE = ((curPrizePool * 0.62) / numWinners) + _
((curPrizePool * 0.1) / numWinners)
End If
End Function
Function THIRDPRIZE(curPrizePool As Currency, numWinners As Integer, numJackPotWin As Integer)
'calculates the thrid prize amount at 28% with and adds rolldown if
'no jackpot winner and/or rounded down to the nearest $.50
If numJackPotWin > 0 Then
THIRDPRIZE = Round(((curPrizePool * 0.28) / numWinners) * 2, 0) / 2
Exit Function
Else
THIRDPRIZE = ((curPrizePool * 0.62) / numWinners) + _
(currPrizePool * 0.28) / numWinners
End If
End Function