Thread: Random
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
arno arno is offline
external usenet poster
 
Posts: 184
Default Random

Hi Tom,

Nigel was referring to the worksheetfunction RAND. You are referring
to the VBA function RND.

uhhh, sorry. Translation problem on my side :)

All random number generators are pseudo random number generators

I think that means, that there is a list of numbers around and excel
picks the numbers from there. If you need a lot of random numbers they
will simply repeat, which will cause some trouble if you need unique
random numbers. Eg. I have macros in reports that write data to a
logfile when the report is opened, a macro run, data updated, closed. I
can link the actions together by a number which I create by random.
Now, I had the problem of repeating numbers (20 reports, lots of people
open them) which I solved with rnd()^rnd() as this simply increases the
number of possible random numbers - the new random number has more
digits.

I always recommend to use randomize plus rnd()^rnd(). Besides creating
"unique" numbers I think that many people try to use Excel random
numbers for some exact scientific analysis. This analysis could be
ignored simply by the fact of using excel as a random number generator
that does not meet scientific expectations to random numbers. I hope my
recommendation "improves" the random numbers of excel.

However, I would greatly appreciate if someone could shed some light on
how "good" excel random numbers are, for what analysis they can be used
for and where one should not use excel.

regards

arno