+ Reply to Thread
Results 1 to 4 of 4

Random distribution of numbers...

  1. #1
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Random distribution of numbers...

    Hi folks,

    I've 7 numbers (-3 to +3) that I need to distribute randomly (as best we can) 2539 times between other entries.

    If possible, as close as we can to the following weights... This is the best way I could phrase it...



    -3 -2 -1 0 1 2 3
    0.05 0.1 0.2 0.3 0.2 0.1 0.05

    Any ideas? I'm sure I've seen a post on here similar to this, and I've tried to mod the following code to suit my needs, but I can't quite get it to work, I think because of the duplicated weights...

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    02-05-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    365
    Posts
    87

    Re: Random distribution of numbers...

    Bumpy bump, even a guess could be helpful here folks, if anyone has even a ballpark idea.... fire away....

  3. #3
    Registered User
    Join Date
    06-22-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Random distribution of numbers...

    Hi,
    This is a complicated one, but try....
    {=INDEX(List,LARGE((ROW(List)-MIN(ROW(List))+1)*(COUNTIF($D$2:D2,List)<>COUNTIF(List,List)),RANDBETWEEN(1,SUM(--(COUNTIF($D$2:D2,List)<>COUNTIF(List,List))))))}
    It does work!

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Random distribution of numbers...

    I'm not entirely sure of just what you want.

    But here's a VBA code that enters your numbers randomly in Range(A1:A2529), with relative frequency according to your indicated weights. Just run it on a blank worksheet and see.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1