Random function

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?
 
N

Norman Harker

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.
 
J

Jay Somerset

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.
 
N

Norman Harker

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top