Flavian
Flavian

Reputation: 1

Excel Help : Random Number Generator

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

Answers (1)

cybernetic.nomad
cybernetic.nomad

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

Related Questions