Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Julian
 
Posts: n/a
Default Can Excel pick random numbers from 1-300 and not repeat numbers?

I need a little programme to select randomly numbers from a list of eg. 1-300
and having selected numbers not to repeat them i.e. electronic drawing
numbers from a hat.
Any suggestions?

Julian Marcus
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Can Excel pick random numbers from 1-300 and not repeat numbers?


First, ensure cell A1 is empty and goto ToolsOptions and on the Calculation
tab check the Iteration checkbox to stop the Circular Reference message.

Next, type this formula into cell B1
=IF(($A$1="")+(AND(B10,COUNTIF($B$1:$B$9,B1)=1)), B1,INT(RAND()*300+1))
it should show a 0

Copy B1 down to Bn.

Finally, put some value in A1, say an 'x', and all the random numbers will
be generated, and they won't change.

To force a re-calculation, clear cell A1, edit cell B1, don't change it,
just edit to reset to 0, copy B1 down to Bn, and re-input A1.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Julian" wrote in message
...
I need a little programme to select randomly numbers from a list of eg.

1-300
and having selected numbers not to repeat them i.e. electronic drawing
numbers from a hat.
Any suggestions?

Julian Marcus



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"