The Sampling tool selects a sample of values from a population. This sample can be chosen randomly or from a specific period. If selecting a random sample, select Random, then enter the number of values to be selected from the population. To only select data from a specific period, say every Sunday from a list of monthly sales data, select Periodic then enter "7" for Period.
The sample dataset below contains daily sales figures for chocolate bars from a small candy store. Generate a sample of five randomly selected values from the population of 31 values.
To generate a random sample:
- On the XLMiner Analysis ToolPak pane, click Sampling
- Enter B1:B32 for Input Range.
- Since cell B1 contains the column heading, select Labels.
- Select Random.
- Enter 5 for Number of Samples
- Enter D2 for Output Range.
- Click OK.
The results are below.
These are five randomly selected values from the total population contained in cells B2:B32.
To generate a sample from a specific period, say from every Sunday:
- On the XLMiner Analysis ToolPak pane, click Sampling
- Enter B1:B32 for Input Range.
- Since cell B1 contains the column heading, select Labels.
- Select Periodic.
- Assuming January 1 fell on a Monday, the first Sunday would fall on January 7, the 2nd Sunday would fall on the 14th, etc. Enter 7 for Period.
- Click OK.
The results are below.
Note that each sampled value is from the 7th period in rows 8, 15, 22, and 29.