Microsoft Office Tutorials and References
In Depth Information
Generating and Using Random Numbers
The syntax for using the ROUND function with the RAND function follows:
=ROUND(RAND() * (high number-low number) + low number,0)
Try it yourself! Here’s how to use RAND and INT together:
1. Position the pointer in the cell where you want the results displayed.
2. Enter =INT(( to begin the formula.
3. Click the cell that has the highest number to be used, or enter such
4. Enter – (a minus sign).
5. Click the cell that has the lowest number to be used, or enter such
6. Enter +1) * RAND() + .
7. Click again on the cell that has the lowest number to be used, or enter
the value again.
8. Type a ), and press Enter.
A random number, somewhere in the range of the low and high number, is
Table 8-1 shows how returned random numbers can be altered with the INT
and ROUND functions.
Using INT and ROUND to Process Random Values
Value Returned with INT
Value Returned with ROUND
Table 8-1 points out how the INT and ROUND functions return different
numbers. For example, 51.71777896 is more accurately rounded to 52. Bear in
mind that the second argument in the ROUND function, 0 in this case, has an
effect on how the rounding works. A 0 tells the ROUND function to round the