Thread: random number
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default random number

=RANDBETWEEN(1,2)

will return 1 or 2 with even distribution
--
Gary's Student


"Jean-Paul De Winter" wrote:

Hi
I need a random number... or it is 1 or it is 2
Now I use this "formula"
score = Int(Right(Val(Second(Now()) * 3.14), 1))
If score = 6 Then score = 2 Else score = 1
it is placed in a loop but doesn't really returns 1 and 2 randomly

Any idea?
Thanks