![]() |
Macro and probabilities
Hello, I explain my problem: I have multiples events, each one with a occurence probability (ex; event A: 20%, event B: 40%, event C: 10%, event D: 30%) I need to create a list of values with my events, respecting the probabilities (ex: creating a list of 100 values, in a aleatory order; with 20 A, 40 B, 10 C and 30D) The thing is that it has to be random, and for a veeery big list (about 9000 entries) Is there a simple way to do it with excel macros, or should I try it another way? Thanks a lot -- MrKermit ------------------------------------------------------------------------ MrKermit's Profile: http://www.excelforum.com/member.php...o&userid=33021 View this thread: http://www.excelforum.com/showthread...hreadid=528467 |
Macro and probabilities
MrKermit,
One way that comes to mind: - make sure the list has a sequential number column - insert another column of random number - sort by that column - delete that column - assign the top 20% rows to A, then 40% to B, etc.. - sort by the sequential number column. NickHK "MrKermit" wrote in message ... Hello, I explain my problem: I have multiples events, each one with a occurence probability (ex; event A: 20%, event B: 40%, event C: 10%, event D: 30%) I need to create a list of values with my events, respecting the probabilities (ex: creating a list of 100 values, in a aleatory order; with 20 A, 40 B, 10 C and 30D) The thing is that it has to be random, and for a veeery big list (about 9000 entries) Is there a simple way to do it with excel macros, or should I try it another way? Thanks a lot -- MrKermit ------------------------------------------------------------------------ MrKermit's Profile: http://www.excelforum.com/member.php...o&userid=33021 View this thread: http://www.excelforum.com/showthread...hreadid=528467 |
Macro and probabilities
Thanks, I'm gonna try it right now... I'll tell you if it worked -- MrKermit ------------------------------------------------------------------------ MrKermit's Profile: http://www.excelforum.com/member.php...o&userid=33021 View this thread: http://www.excelforum.com/showthread...hreadid=528467 |
All times are GMT +1. The time now is 03:00 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com