Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 733
Default random numbers repeating

John T wrote...
I'm using random number generation using randbetween(0,10).

Is there a way of stopping it from displaying the same number twice in
a row?


No, because there's nonzero probability that drawing from 0..10 with
replacement will produce duplicates.

If you could live with circular recalc, run the menu command Tools
Options, select the Calculation tab in the Options dialog, check the
Iteration box and set Maximum iterations to 1. Then try the following
formula in cell A1.

=MOD(A1+RANDBETWEEN(1,10),11)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default random numbers repeating

On 23 Jan 2007 12:49:04 -0800, "Harlan Grove" wrote:

John T wrote...
I'm using random number generation using randbetween(0,10).

Is there a way of stopping it from displaying the same number twice in
a row?


No, because there's nonzero probability that drawing from 0..10 with
replacement will produce duplicates.

If you could live with circular recalc, run the menu command Tools
Options, select the Calculation tab in the Options dialog, check the
Iteration box and set Maximum iterations to 1. Then try the following
formula in cell A1.

=MOD(A1+RANDBETWEEN(1,10),11)


Thanks for your suggestion, it almost works but throws up other
problems in the file.

Cheers

John T

To reply by email take out "the rubbish"


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default random numbers repeating

The standard way do sampling without replacement is to list the available
values (0,1,...,10), in the next column put random numbers (e.g. =RAND(), but
then Copy/Paste Special Values to keep them from recalculating). Sort both
columns by the random numbers, then select from the now randomized list of
integers between zero and ten.

Jerry

"John T" wrote:

On 23 Jan 2007 12:49:04 -0800, "Harlan Grove" wrote:

John T wrote...
I'm using random number generation using randbetween(0,10).

Is there a way of stopping it from displaying the same number twice in
a row?


No, because there's nonzero probability that drawing from 0..10 with
replacement will produce duplicates.

If you could live with circular recalc, run the menu command Tools
Options, select the Calculation tab in the Options dialog, check the
Iteration box and set Maximum iterations to 1. Then try the following
formula in cell A1.

=MOD(A1+RANDBETWEEN(1,10),11)


Thanks for your suggestion, it almost works but throws up other
problems in the file.

Cheers

John T

To reply by email take out "the rubbish"



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate Random numbers from a pre-defined set frankjh19701 Excel Worksheet Functions 0 January 11th 07 05:20 PM
Generate Random numbers from a pre-defined set frankjh19701 Excel Worksheet Functions 0 January 11th 07 05:20 PM
Generation of random numbers and sum of those with a condition ramana Excel Worksheet Functions 11 October 5th 05 05:01 AM
Random Numbers anuterrnd Excel Worksheet Functions 1 July 22nd 05 05:32 AM
Random list (1-45) without repeating numbers? Hayes Excel Worksheet Functions 1 November 21st 04 10:01 PM


All times are GMT +1. The time now is 02:23 AM.

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"