Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Random Number

  1. #11
    Board Regular eliW's Avatar
    Join Date
    Mar 2002
    Posts
    1,919
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    Eli,

    Your first formula (slightly modified here) appears to me elegant and satisficing:

    =IF(RANDBETWEEN(0,1),RANDBETWEEN(1,10),RANDBETWEEN(20,30))

    The size of <1,10> is eq to that <20,30>. Is there something I'm missing?

    Regards,

    Aladin
    Hi Aladin,
    1-10 contains 10 numbers, 10-20 contains 11 numbers, therefore the randomal numbers which is formed by the first formula would be biased so that there will be statistically slightly more numbers between 1-10 than between 20-30.
    Do I make myself clear?
    Therfore the second suggestiom is making compensation of that.
    The exact formula would be:
    =if(randbetween(1,21)<=10,randbetween(1,10),randbetween(20,30))
    Regards,
    Eli

  2. #12
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    83,637
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    6 Thread(s)

    Default

    On 2002-03-31 09:05, eliW wrote:

    Eli,

    Your first formula (slightly modified here) appears to me elegant and satisficing:

    =IF(RANDBETWEEN(0,1),RANDBETWEEN(1,10),RANDBETWEEN(20,30))

    The size of <1,10> is eq to that <20,30>. Is there something I'm missing?

    Regards,

    Aladin
    Hi Aladin,
    1-10 contains 10 numbers, 10-20 contains 11 numbers, therefore the randomal numbers which is formed by the first formula would be biased so that there will be statistically slightly more numbers between 1-10 than between 20-30.
    Do I make myself clear?
    Therfore the second suggestiom is making compensation of that.
    The exact formula would be:
    =if(randbetween(1,21)<=10,randbetween(1,10),randbetween(20,30))
    Regards,
    Eli
    I was aware of the reason. I thought: "The sizes of intervals are eq -- what is he worried about?" Gee, back to the elementary for me .

  3. #13
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Aladin..

    No just us exceller being difficult AS ALWAYS..

    you formua is PERFECTION.. but this is a case of...

    6 differen number in one cell, no two the same..

    Kinda tough.. Any ideas mate!

    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •