How to sample data without returning duplicates?
Thanks! That solved both problems at the same time. I know about the rand()
function, but it never occurred to me to use it in this way. Thanks again!
"joeu2004" wrote:
On Aug 7, 8:38 am, Ralph E Brown <Ralph E
wrote:
1) Most important is when I run a sample of my range, the process will
return duplicate values in the sample.
[....] Is there a way to prevent this, so that every value returned appears
only once in the sample?
2) The data I want to sample is alpha, not numeric. However the Sampling
feature apparently only works with numeric input data. How can I get around
this limitation.
There are at least two common approaches. Arguably, the simplest one
is as follows....
Assume your data is in one column. In each cell in an adjacent
column, put the formula =RAND(). Note: The value of those cells will
change every time you modify the worksheet. Sigh. No matter: the
actual values do not matter, only that they are random.
Now select the range that includes your data and the adjacent column
of random values. Click on Data Sort to sort the random column.
This will reorder your data as well. If you select the first "n" of
the data column, it will be random without duplication (assuming all
of your data are unique).
|