Random function

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I am trying to get ramdom samples between the numbers 1 - 25 w/o
replacement.

randbetween() will put the number back and hence will give the same number
several times.

Any suggestions?
 
Hi Tim!

One way is to use the following approach:

It's based upon setting up a column with numbers 1:25 with =RAND() set
up against each number. You then sort the two columns of numbers based
upon the random number and that gives the numbers 1:25 in random
order. Take whatever size sample you want from the top down and there
you have it; random numbers between 1 and 25 without replacement.

If you want multiple sets, then copy and paste special values to
another area and then recalculate and re-sort.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Hi Tim!

One way is to use the following approach:

It's based upon setting up a column with numbers 1:25 with =RAND() set
up against each number. You then sort the two columns of numbers based
upon the random number and that gives the numbers 1:25 in random
order. Take whatever size sample you want from the top down and there
you have it; random numbers between 1 and 25 without replacement.

If you want multiple sets, then copy and paste special values to
another area and then recalculate and re-sort.

The SORT will generate a new set of random numbers. The sort actually takes
place using the original set. Hitting F4 (to resort) will generate a new
random ordering of the 1:25 integers. It just will not be in the order
given by the random numbers visible after the sort is complete, but the ones
that have now been replaced. Visually confusing, but statistically correct.
 
Thanks Jay!

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top