Reputation: 1
In Excel on the Random Number Generation function, how can I add probabilities to my range of numbers generated? Example : If I have a range from -1 to 2 let's say, how can I tell excel to generate 30% negative and 70% positive numbers?
Upvotes: 0
Views: 210
Reputation: 6368
This will provide you with the distribution you want:
=IF(RAND()<=0.3,RANDBETWEEN(-1,0),RANDBETWEEN(0,2))
This will provide fractional numbers with the distribution you want:
=IF(RAND()<=0.3,-RAND(),2*RAND())
Upvotes: 2