Help regarding random sampling

M

mecivil

I have to develop a user-defined function that can
be used to do random sampling of one or more elements from a sampling
frame listed in a range in Excel
When two or more elements are
sampled, the sampling needs to be done without replacement.

How can i achieve this?
 
D

DanR

Look for 'help' on Randomize and rnd
like below:
'Returns a random number from one(1) to nine(9)
Randomize
Random19 = Int(9 * Rnd + 1)

You will have to setup your own macro based on your sample.

DanR
 
G

Gary''s Student

In the simplest case, assume that all the elements are in a single column,
column A. If this is not true, then first move the elements to a single
column.

If column B enter:
=RAND() and copy down as far as column A

Sort both columns by column B. This will "shuffle" the elements in column A

Then just get the top set of elements from column A:
A1 thru A3 to sample three
A1 thru A7 to sample 7
etc.
 

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

Similar Threads

Excel Random Sampling 2
Math formula help 5
Excel: Probility 0
Random Sampling 2
SAMPLING FOR AN AUDIT 1
Formula numbers and text Trying to pull a random sampling 1
Sampling 1
Random Sampling rows 2

Top