Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 04 Aug 2008 22:28:59 GMT, Lars-Åke Aspelin
wrote: On Mon, 4 Aug 2008 12:30:14 -0700, Okstate_Fan131313 wrote: I'm trying to find a way to randomly choose a number within a given range but have a given frequency for each random number. For example. Range: 1-5 Frequency of appearance: 1=5% 2=10% 3=30% 4=50% 5=5% I was trying to find a way using the random function with upper & lower bounds but wasn't sure how in incorporate the "frequency of appearance" factor. Any and all help is greatly appreciated, Thanks. Try the following formula to get a random number from 1 to 5 with the frequencies stated above: =MAX((RAND(){0,0.05,0.15,0.45,0.95})*{1,2,3,4,5} ) Note that the numbers in the first array are the cumulative frequencies. Hope this helps / Lars-Åke And for the unlikely event that RAND() should return exactly 0, the formula should rather be like =MAX((RAND()={0,0.05,0.15,0.45,0.95})*{1,2,3,4,5} ) Lars-Åke |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamic range generator | Excel Programming | |||
Random Generator | Excel Discussion (Misc queries) | |||
Random Name Generator | Excel Worksheet Functions | |||
Random Number Generator | Excel Worksheet Functions | |||
Random # Generator | Excel Worksheet Functions |