Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help regarding random sampling

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Help regarding random sampling

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

"mecivil" wrote in message
...
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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Help regarding random sampling

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.
--
Gary''s Student - gsnu200743


"mecivil" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
random sampling staciern Excel Discussion (Misc queries) 5 May 25th 10 04:29 PM
Random Sampling Deb Excel Discussion (Misc queries) 0 June 24th 09 06:33 PM
Random Sampling - Please Help! Lee Mathew Excel Worksheet Functions 2 July 15th 08 11:45 PM
Random Sampling Pandorah Excel Discussion (Misc queries) 7 June 30th 07 07:44 AM
Random Sampling Andrea Excel Discussion (Misc queries) 2 November 11th 05 09:52 AM


All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"