View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Use RANDBETWEEN form & include certain #'s in the range

P.S.

I once tested for RAND = 0.000000000000000 through 10 million iterations.

Result = 0

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
The worksheet function RAND() does not
guarantee non-repeating random numbers.
It is unlikely, but not impossible (=unsafe).


I wonder if anyone has ever tested RAND for duplicates. I'm sure someone
has done it at some point.

See how many dupes you get in say, 10 million iterations.

RAND = 15 digits (0 to 9)

=PERMUT(15,10)

=10,897,286,400

--
Biff
Microsoft Excel MVP


"Bernd P" wrote in message
...
Hello,

If the series should be complete & non-repeating, select 10 adjacent
cells horizontally and array-enter
=INDEX({1,9,26,31,500,15,350,405,233,1000},VBUniqR andInt(10,10))
or vertically and array-enter
=INDEX({1,9,26,31,500,15,350,405,233,1000},TRANSPO SE(VBUniqRandInt
(10,10)))
My UDF UniqRandInt you can find he
http://sulprobil.com/html/uniqrandint.html
Delete the Application.Volatile command if you do not want to get
changed values each time you press F9.

BTW: The worksheet function RAND() does not guarantee non-repeating
random numbers. It is unlikely, but not impossible (=unsafe).

Regards,
Bernd