MrExcel Publishing
Your One Stop for Excel Tips & Solutions

random number generation

Posted by Toni on December 17, 2001 8:44 PM

How do you use Random Number Generation in Excel 97?
It is under tools, data analysis in Excel 2000.

Posted by Eric on December 17, 2001 9:27 PM

You are correct.
Tools->Data Analysis->Random Number Generator

To use.
Lets say you want to generate some random numbers between two values. That is all I have ever used it for.

I go to the generator and tell it...

1) How many columns these numbers will spread across (Number of Variables)

2) Then how many rows they will spread across (Number of Random Numbers)

3) Then I pick Uniform Distribution (there are different ways to generate numbers with different distributions.)

4) Then I tell it the values that the random numbers must be between.

5) Then just make up a random seed preferably long and different numbers.

6) Then you can make it put these numbers in a new workbook or new worksheet or and output range(select the first cell to start were all the random numbers will be placed).

7) Click OK and all the numbers will be generated.

I do not know how to make it generate different numbers every time you start up (just a macro I think). And I dont know how to make it use a different seed every time (probably a macro also).

Posted by Alix on December 18, 2001 2:26 AM

An alternative if you only want random numbers between two values is
where x is the lowest value in the range and y the highest. This number will change on recalculation

For either of these methods to work you need the Analysis ToolPak Add-In enabled. If it is not, go to:
Tools -> Add-Ins and check the box for Analysis ToolPak.