Thursday, July 21, 2016

The Excel Slot Machine



Excel users can be a very sensible lot, but Not Everything in Excel needs to be so terribly Serious. In fact, you can take some the very sensible tools in Excel and have some Fun with them. The post I made back in late 2012 has been one of the most popular in the 8 years I have been writing this blog.

It all revolved around using the fascinating RAND function for purposes not originally intended. In this case, an Excel Slot Machine!

The intriguing RAND function returns a Random Number that is Greater Than or Equal to 0 and Less Than 1. Each time your worksheet recalculates, (by reopening or forced recalculation by pressing F9), the RAND function returns a New Random Number.

Of course, some hard core statisticians have voiced concerns about the true Randomness of the RAND function (it is prone to sequential correlations if large runs of numbers are taken), but it more than suffices for most demanding statistical applications, and is certainly acceptable for us mere mortals.

The Syntax for the Rand function is simply: RAND( )

If you want to create a random number between two numbers, (where a is the smallest number and b is the largest number), you can use: =RAND()*(b-a)+a

If you want only Whole Numbers try using: RANDBETWEEN()

For example, =RANDBETWEEN(1, 100) will produce a Random Whole Number between 1 and 100.

There are countless statistical applications, of course, but you can also use it to have a bit of Fun. I have used the RAND function in conjunction with other functions and graphics to create a Slot Machine in Excel (send me a request at excelenthusiast@gmail.com if you would like a copy of the Slot Machine spreadsheet). I will be happy to send a copy to you.

Is an Excel Slot Machine an acceptable application of the power of Excel? Well, certainly some of the more Sensible ones among us may not think so, but hey, it’s good to have a bit of fun now and then. The RAND function. Great for use in statistical applications, building games, slot machines, and other Fun Stuff!

No comments: