Hints and tips home » Excel hints and tips » Generating Random Numbers
Generating Random Numbers
To generate a random number in Excel use the = RAND() function.
The value returned will always be between 0 and 1. To convert this to some other random value, you will need to multiply the result by the highest number you want to consider. For example, if you wanted a random number between 1 and 25, you could use the following code line:
= INT(25 * RAND()+ 1)
Since RAND() will always returns a value between 0 and 1 (but never 1 itself), multiplying what it returns by 25 and then using the Integer function INT on that result will return a whole number between 0 and 24.
Finally, 1 is added to this result, so that x will be equal to a number between 1 and 25, inclusive
Added by Orok on 26th October 2006
More Excel hints and tips, like:
|
» Forum post: Earned value formulas |



Course updates

