September 2011
Beginner
140 pages
3h 40m
English
The RAND function returns a random fractional number between 0 and 1. To make it a bit more useful, you can multiply it by 10 and use TRUNC to turn the results into integers from 0 to 10. Here's an example:
=TRUNC(RAND()*10)
Multiplying RAND by 100 in the preceding example returns numbers from 0 to 100.
Figure 6-6. Sample result of the RAND function
If you want random numbers from a different range, such as 1970 to 2010, use the following trick:
=TRUNC(RAND()*40)+1970
See also the section on the TRUNC function.
Read now
Unlock full access