The RAND() function is used to generate random numbers, which can be used in various ways in spreadsheet models.
The RAND() function takes the form
=RAND()
This generates a random number in the range 0.0 - 0.9999. There is no need for a value in the brackets but you may want to scale the number generated into something more useful.
A typical result is 0.708442366.
To set the range of values to 1-100 do something like this:
=RAND()*100
To convert this to a whole number do something like this:
=TRUNC(RAND()*100))
To generate a random number in the range 1-20 try this:
=TRUNC(RAND()*20))
To generate a random number in the range 20-100 try this:
=TRUNC(RAND()*80+20)
Any change to a spreadsheet containing the RAND() function will generate a new random number. To generate random numbers without changing anything in a worksheet press the F9 (recalculate) button. This is used to force recalculation of all formulae and functions if recalculation has previously been turned off.
One application of random numbers is to put a list into random order. Take a list of names, add random numbers in a separate column and then sort the columns on the random numbers.
The RAND() function can be used in simulations where the value returned represents an approximation of an event in the real world. For example, we might simulate the sales made by a lemonade stall in a street somewhere.
The RAND() function can be used to simulate throwing dice.
One possible design for simulating a lemonade stall can be found here.
Another example, using the example of electricity usage, can be found here.
Press the Back Button to return