Random Numbers… coin toss
Excel has two random number generators. I use them to create random data for teaching purposes mostly, but they can also be used in many other ways. One that I like is recreating a classic coin toss.
First, let’s look at the two types of Random functions in Excel:
In RAND(), Excel generates a random number between0 and 1. RANDBETWEEN generates a number given your input (given the low and high ends of a range).
For example, to generate a random number between 1 and 10, the formula would read =RANDBETWEEN(1,10)
Now, let’s look at the coin toss:
RAND() will give us a number between 0 and 1, but coin tosses are binary: it can only be heads or tails. So we need to convert the random decimal number to either 0 or 1. How about ROUND? If the number is random, then we can assume that half of the time it will be less than .5 and half the time greater than .5.
Now we have: =ROUND(RAND(),0)
One final step will make this complete. We want to say that if the result is 0, the coin toss is heads; if the result is 1, the coin toss is tails.
There you have it!
Note: all random functions will refresh with new values whenever the sheet recalculates.
See this and other Random examples in Random numbers (Excel 2007)