Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
random number
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
random number
This yields a positive integer of 1 or 2; as random as XL is using the built
in random function score = Int((2) * Rnd + 1) -- Cheers Nigel "Jean-Paul De Winter" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
random number
If you are using Excel 2003 then make sure that this issue is addressed ...
http://support.microsoft.com/kb/834520/ -- Cheers Nigel "Gary''s Student" wrote in message ... =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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
random number
Or
=1+(RAND()0.5) -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Jean-Paul De Winter" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Addding a Random number to a fixed number..... | Excel Discussion (Misc queries) | |||
How can I match a random number with closest number from sequence? | Excel Worksheet Functions | |||
same number appears in a random number generator | Excel Worksheet Functions | |||
Generating (in a random order)each number once from a given number | Excel Worksheet Functions | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) |