Wednesday, March 23, 2011

How to Use Excel to Generate Random Samples


1. Determine a range of numerical data in an Excel worksheet from which you want to generate a random sample. For example, generate a random sample from the numbers 1 through 10 listed in the first column in cells A1 through A10.
2. Click the 'Data' tab at the top of Excel and click 'Data Analysis' in the 'Analysis' group.
3. Click 'Sampling' in the 'Analysis Tools' list, then click 'OK.' This brings up a small window called 'Sampling.'
4. Click the button with the red arrow next to box called 'Input Range' in the 'Input' section. This shrinks the sampling window to a single row in which you can enter an input range.
5. Click and hold the left mouse button in the top left cell of the range of data from which you want to generate a random sample. For example, click and hold the left mouse button in cell A1.
6. Drag the mouse to the bottom right cell in the range of data, then release the mouse button. This shows the range of cells that contain the population data in the sampling window. For example, drag the mouse to cell A10 and release. Excel shows '$A$1:$A$10' in the sampling window.
7. Click the button with the red arrow in the sampling window to expand the window to its original size and show the other options.
8. Click the 'Random' button in the 'Sampling Method' section of the sampling window and type the number of samples you want Excel to generate in the box titled 'Number of Samples.' For example, click the 'Random' button and type '10' in the box.
9. Click the 'New Worksheet Ply' button in the 'Output options' section to tell Excel to place your sample in a new worksheet.
10. Click 'OK.' Excel generates a list of random samples and lists them in a column in a new worksheet with the first sample in cell A1. In the example, Excel lists random numbers between 1 and 10 in cells A1 through A10 in a new worksheet.

Blogger news