|
|
Generating unique random number
Version: 2008
Operating System: Mac OS X 10.6 (Snow Leopard)
Processor: Intel
I need to select 5 items from a list of 50. When I use RANDBETWEEN(1,50), I get duplicates more often than not. Is there a different function or some simple way to generate 5 unique numbers?
|
|
0
|
|
|
|
Reply
|
Iggles14
|
6/5/2010 3:02:34 PM |
|
In article <59bb96b5.-1@webcrossing.JaKIaxP2ac0>,
Iggles14@officeformac.com wrote:
> Version: 2008
> Operating System: Mac OS X 10.6 (Snow Leopard)
> Processor: Intel
>
> I need to select 5 items from a list of 50. When I use RANDBETWEEN(1,50), I
> get duplicates more often than not. Is there a different function or some
> simple way to generate 5 unique numbers?
I of course would strongly recommend R language "sample()" or the
equivalent in Matlab.
Your difficulty is that you don't want a single random sample, nor do
you want 5 random samples. What you want is the first five elements of
a random permutation of the values 1 thru 50. And by the way,
apparently you are looking only for random integers?
I doubt you can achieve what you want in Excel (not counting painful
macro function writing).
--
Team EM to the rescue! http://www.team-em.com
|
|
0
|
|
|
|
Reply
|
Carl
|
6/5/2010 5:44:59 PM
|
|
Iggles14 -
The simplest way, especially if you only need to do it once, is to use a
helper column.
In an adjacent column, enter =RAND() and copy down. (Optionally, edit-copy
and edit-paste-special-values.) Choose Data > Sort to sort the two columns.
(If you didn't paste-special-values, new random numbers will appear; ignore
them.) Then use the top five as your "sample without replacement."
- Mike
http://www.MikeMiddleton.com
Mike@DecisionToolworks.com
<Iggles14@officeformac.com> wrote in message
news:59bb96b5.-1@webcrossing.JaKIaxP2ac0...
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor:
Intel
I need to select 5 items from a list of 50. When I use RANDBETWEEN(1,50), I
get duplicates more often than not. Is there a different function or some
simple way to generate 5 unique numbers?
|
|
0
|
|
|
|
Reply
|
Mike
|
6/5/2010 11:30:55 PM
|
|
|
2 Replies
1090 Views
(page loaded in 0.038 seconds)
Similiar Articles: Generating unique random number - microsoft.public.mac.office ...Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I need to select 5 items from a list of 50. When I use RANDBETWEEN(... generate a random 6 digit number - microsoft.public.access ...Generating unique random number - microsoft.public.mac.office ... MS SQL Server :: How To Create A Sequence Generator Number In SSIS... to generate unique 6 digit random ... Generating a random ID on a form. - microsoft.public.access.forms ...how to generate a unique random number on a form submission? - ASP.Net how to generate a unique random number on a form submission?. I want to generate a ... from the ... Generate random numbers - Using initial seed - microsoft.public ...Generating unique random number - microsoft.public.mac.office ... What you want is the first five elements of a random permutation of the ... After the couple of articles ... Generating random numbers - microsoft.public.excel.worksheet ...Generating unique random number - microsoft.public.mac.office ... Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I need to select 5 items ... generating random numbers without repeats - microsoft.public.excel ...Generating unique random number - microsoft.public.mac.office ... generating random numbers without repeats - microsoft.public.excel ... How do you randomly assign numbers ... RANDBETWEEN generating numbers outside range - microsoft.public ...Generating unique random number - microsoft.public.mac.office ... RANDBETWEEN generating numbers outside range - microsoft.public ... Simple task of trying to generate a ... How do you randomly generate numbers in Excel 2007? - microsoft ...Generating unique random number - microsoft.public.mac.office ..... excel ... How do you randomly assign numbers ... generate any unique random numbers, strings, dates ... Assign random numbers - microsoft.public.accessGenerating unique random number - microsoft.public.mac.office ... Assign random numbers - microsoft.public.access Hi All, I need to assign a unique number to a set of ... Generate increment numbers automatically - microsoft.public.access ...Generating unique random number - microsoft.public.mac.office ... MYSQL auto increment field to generate unique number from a table MySQL will generate ... Random Numbers: Generating Unique Random NumbersSometimes the random numbers to be picked need to be unique. ... Once you know how to generate random numbers it's often the case that the numbers also need to be ... Random Generator for Excel 2010 - generate random numbers ...Excel Random Generator can generate any unique random numbers, passwords, dates, strings, GUIDs and codes. Free download for Excel 2010, 2007, 2003. Excel: how to generate unique numbers, integers, datesHow to quickly generate unique numbers, integers, dates with Excel Random Number Generator. An add-in for Microsoft Excel 2010, 2007, 2003, XP and 2000. Jack of all Tirades: Generating a list of unique random numbersHere's a useful function for generating a list of N random numbers from a larger list M: function randList(max:Number, num:Number, shuffled:Boolean):Array XL2000: How to Create Unique Random Integers Between Two Numbers... the user for a starting integer and an ending integer, prompts the user to input the number of random numbers to generate, and then generates a list of unique ... 7/19/2012 8:15:46 PM
|
|
|
|
|
|
|
|
|