View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glenn Glenn is offline
external usenet poster
 
Posts: 1,240
Default how to eliminate duplicate numbers

Name a sheet RANDOM. In cell A2 put the formula

=RAND()

and then copy it down and across to D26.



On the sheet where you want the random sequence, in cell A2 put

=RANK(RANDOM!A2,RANDOM!$A$2:$D$26)

and copy down and across to D26.


OPer wrote:
I did not explain my self well. What I am doing is genarating random
sequences numbers from 1 to 100. When I use the formula randbetween(1,100) in
'A2' and copy to range 'D26', it did give me duplicate numbers.

"Gary''s Student" wrote:

Say your data is in column B from B2 thru B1000 and we want to sample 100 of
these values with no repeats.

In A2 thru A1000 enter:
=rand()

In E2, enter:
=OFFSET($B$2,MATCH(LARGE($A$2:$A$1000,ROW()),$A$2: $A$1000,0),0)
and copy down thru E101

--
Gary''s Student - gsnu200903


"OPer" wrote:

I am trying to extract a random sample of 100 numbers .
The problem that I'm having is that the sample keeps coming up with
duplicate numbers.

Can anyone tell me how I can eliminate these duplicates?

Any help would be appreciated