Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Generate random sequence based on probability

I have a list of events and the probability that each will happen. Example:
Event A 12%
Event B 20%
Event C 2% ...and so on.
My list is about 20 entries long. What I want to do is to have Excel
randomly determine what event will happen in what order, based on the
percentage chance that it will happen. So I want 20 cells in another column
with the results looking something like this:
Event K
Event B ...and so on. And be able to recalculate upon refresh.

Thanks in advance!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Generate random sequence based on probability

Assuming the list is in A1:A20 - In cell C1 type:
=INDEX($A$1:$A$20,MATCH(LARGE($B$1:$B$20,ROW()),$B $1:$B$20,))
and copy down to C20
Micky


"James R" wrote:

I have a list of events and the probability that each will happen. Example:
Event A 12%
Event B 20%
Event C 2% ...and so on.
My list is about 20 entries long. What I want to do is to have Excel
randomly determine what event will happen in what order, based on the
percentage chance that it will happen. So I want 20 cells in another column
with the results looking something like this:
Event K
Event B ...and so on. And be able to recalculate upon refresh.

Thanks in advance!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Generate random sequence based on probability

This will produce a static list based on the assigned %age, however if you
want to randomise the result then the following will give you this:

in cell C1 =Rand()*B1

and in cell D1 put Mickey's answer, but change the reference from colmn B to
C...

=INDEX($A$1:$A$20,MATCH(LARGE($C$1:$C$20,ROW()),$C $1:$C$20,))

Drag the formulae down and the order will change on every calculation event
randomly, but wheighted by the %age assigned...

--
If this is the answer you hoped for please remember to click the yes button
below...

Kind regards

Rik


"מיכאל (מיקי) אבידן" wrote:

Assuming the list is in A1:A20 - In cell C1 type:
=INDEX($A$1:$A$20,MATCH(LARGE($B$1:$B$20,ROW()),$B $1:$B$20,))
and copy down to C20
Micky


"James R" wrote:

I have a list of events and the probability that each will happen. Example:
Event A 12%
Event B 20%
Event C 2% ...and so on.
My list is about 20 entries long. What I want to do is to have Excel
randomly determine what event will happen in what order, based on the
percentage chance that it will happen. So I want 20 cells in another column
with the results looking something like this:
Event K
Event B ...and so on. And be able to recalculate upon refresh.

Thanks in advance!!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Generate random sequence based on probability

Great answers, both of you. Thanks, Rik and Mickey! However, I have a couple
of concerns:
1. In the last record of the "INDEX" formula, I get a "#NUM" error that I
can' seem to fix.
2. I understand that just because something has, for example, a 35%
probability of happening first that it won't happen first 35% of the time.
However, that event is not even coming close to happening 30 % of the time.
Any thoughts?

Thanks,
James

"Rik_UK" wrote:

This will produce a static list based on the assigned %age, however if you
want to randomise the result then the following will give you this:

in cell C1 =Rand()*B1

and in cell D1 put Mickey's answer, but change the reference from colmn B to
C...

=INDEX($A$1:$A$20,MATCH(LARGE($C$1:$C$20,ROW()),$C $1:$C$20,))

Drag the formulae down and the order will change on every calculation event
randomly, but wheighted by the %age assigned...

--
If this is the answer you hoped for please remember to click the yes button
below...

Kind regards

Rik


"מיכאל (מיקי) אבידן" wrote:

Assuming the list is in A1:A20 - In cell C1 type:
=INDEX($A$1:$A$20,MATCH(LARGE($B$1:$B$20,ROW()),$B $1:$B$20,))
and copy down to C20
Micky


"James R" wrote:

I have a list of events and the probability that each will happen. Example:
Event A 12%
Event B 20%
Event C 2% ...and so on.
My list is about 20 entries long. What I want to do is to have Excel
randomly determine what event will happen in what order, based on the
percentage chance that it will happen. So I want 20 cells in another column
with the results looking something like this:
Event K
Event B ...and so on. And be able to recalculate upon refresh.

Thanks in advance!!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default Generate random sequence based on probability

Hello James,

I suggest to use my UDF redw:
http://sulprobil.com/html/distributions.html

Regards,
Bernd


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default Generate random sequence based on probability

Hello James,

If the "likelihood" is not sufficient for you then have a look at my
UDF ExactRandHistogrm, please:
http://sulprobil.com/html/exactrandhistogrm.html

Regards,
Bernd
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
Probability of random numbers Soccer boy[_2_] Excel Discussion (Misc queries) 1 January 21st 09 05:40 PM
How do I generate a Sequence Number System in Excel? scoleman001 Excel Discussion (Misc queries) 1 December 8th 08 10:11 PM
generate a random number and use if function to generate new data Dogdoc1142 Excel Worksheet Functions 4 April 26th 06 03:44 AM
GENERATE RANDOM NUMBERS BUT EXCLUDE A NUMBER IN THE SEQUENCE Tracker Excel Discussion (Misc queries) 6 August 5th 05 02:49 AM
Selecting at random with weighted probability Damage Excel Worksheet Functions 2 January 31st 05 11:06 PM


All times are GMT +1. The time now is 08:33 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"