Finding the general solution
The Formula Solution
- RANDBETWEEN(1,6) + RANDBETWEEN(1,6) would be the result of rolling 2 standard dice.
The VBA Solution
- There can be only one kind of die.
- The numbers on the dice are sequential, e.g. if you say the lowest number on a face is 1 and the largest 6, it assumes the numbers are 1, 2, 3, 4, 5, and 6.
- The dice are "fair" in the sense that each face is as likely to appear as any other.
- The inputs(parameters) are
- Bottom: The lowest number on a face of the dice.
- Top: The highest number.
- Dice: The number of dice
What's the number?
- DiceThrow(1,6,2) would give the roll of two normal dice each time the sheet was recalculated.
- Names: Set1Bottom, Set1Top, and Set1Dice could be 1, 6, and 2, respectively, indicating a pair of "normal" dice.
- DiceThrow(Set1Bottom,Set1Top, Set1Dice) would give the roll.
Bell Curve pseudo-data
Data begins at ...
- DiceThrow(1,6,2) - 1 ' A pair of standard dice, subtracting 1 from the result each time
- DiceThrow(0,5,2) + 1 ' Six-sided dice, numbered blank (zero) to five, adding 1 to the result
- DiceThrow(1,6,1) + DiceThrow(0,5,1) ' unequal dice
...and to what ever number is needed
- DiceThrow(1,3,1) + DiceThrow(0,5,4)
- DiceThrow(1,5,1) + DiceThrow(0,6,3)
- DiceThrow(1,2,1) + DiceThrow(0,1,3) + DiceThrow(0,6,3)
back and forth in time...
- Round(Now(),0) + DiceThrow(x,y,z) would give dates in the future
- Round(Now(),0) - DiceThrow(x,y,z) would give dates in the past
- Round(Now(),0) + iif(DiceThrow(0,2,1) = 1,-1,1) * DiceThrow(x,y,z) would give dates in the past and future
- The DateAdd() funcion could be used for larger & smaller time increments.