Statistics 23,
"Random" Number Generation, using EXCEL97
 


Here is a list of simple steps, that is one way to use Excel97 to generate a "random" number, chosen from 1,2,3,...,7.  You can change  "7"  to anything that you prefer by obvious modification of the steps below.
 
 

Step 1:  Start Microsoft EXCEL97  (e.g. using Start button   ---   Programs   ---   Microsoft Excel)
 

Step 2:  Put the number 1 in the Spreadsheet Entry A1, and put 2 in A2.  Then the screen should look something like:


 

Step 3:  This can turned into a long column of counting numbers, 1,2,3,...,7, by using the mouse to pull the little square (on the lower right hand corner of the highlighted box) downwards.  Pulling it down to the entry A7 gives a screen something like:

It won't harm things if you pull it further, and that may make it easier to change 7 to other numbers later.
 

Step 4:  Put "=1/7" in the entry B1.  Note the "=" part tells Excel to compute this as a number.  If you don't put that, Excel may try to interpret this as a date.  If you have already put a date in the cell, you need to change the format to "number", using the  "format" on the tool bar, then the "cells..." menu.  While formatting, you may also want to have EXCEL  show more of the decimal places that it is using.)  The screen should then look like:


 

Step 5:  Turn this into a column of "1/7"s by again dragging the little square downwards, to give a screen something like:


 

Step 6:  Pull up the "Data Analysis Menu", from a screen something like:

If you don't have the "Data Analysis..." Option that appears on the bottom of this menu, you need to load the "Analysis ToolPak" as discussed on the  Stat 23 Home Page.
 

Step 7:  This should give a window something like:

Slide the control bar on the right downwards, until you see the entries given here (they may be below what you see at first).  Use the mouse to highlight "Random Number Generation" (as shown here), and click "OK".
 

Step 8:  This should give a window something like:

Fill out the fields as they are shown here, then click "OK".  (Note:  the downwards arrow to the left of the "Distribution:" Box pulls down a menu that "Discrete" can be selected from).
 

Step 9:  This should result in a screen that looks something like:

The "random number", 3 in the screen above, appears in the specified cell, D1.
 

Step 9:  Experiment with drawing another random number, by the same steps as above (note:  the information you saved in the "Random Number Generation Menu" is still there).
 

Step 10:  Experiment with the entries in the  "Random Number Generation Menu", to figure out how to get more than one random number at once.  Think about how to change the range 1-7 (from which the numbers are drawn) to some other range {Hint: you need to make changes in both Columns A and B.  Be sure that column B still sums to 1.}
 
 
 



 

Back to Stat 23 Home Page
 

Back to Marron's Home Page