Thread
:
Generate random number from a list
View Single Post
#
6
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
external usenet poster
Posts: 174
Generate random number from a list
Hello Harlan,
Couldn't you also do without INT?
=INDEX($A$2:$A$300,1+299*RAND())
"Harlan Grove" wrote:
wrote:
Not
=INDEX($A$2:$A$300,1+INT(300*RAND()))
?
Now we've both made mistakes. Your 2nd argument would return 300 when
RAND() 299/300, but then your INDEX call would return #REF!. Mine
would error when RAND() 298/299, a bit more frequent, and it'd never
return the value in cell A2. It should be
=INDEX($A$2:$A$300,1+INT(299*RAND()))
or
=INDEX($A$1:$A$300,2+INT(299*RAND()))
Reply With Quote
daddylonglegs
View Public Profile
Find all posts by daddylonglegs