Help for Random Number Generation

K

krisinvincible

Hi, Guys,
I would really appreciate if any one of you guys can help me with the
following question.

I want to generate two numbers a, b which satisfies the following conditions
1. a<0, b>0 and
2. b-a always lies between 0.2 and 0.8.

Much Thanks for your help
 
D

dq

A1: =-RANDBETWEEN(0,9999999)/10000
A2: -RANDBETWEEN(-(A1+0.8)*10000,-(A1+0.2)*10000)/10000

Change the values 9999999 and 10000 according to the range and
accuracy you require.

DQ
 
G

Gary''s Student

For b in B1 enter:

=0.6*RAND()+0.2

For a in A1 enter:

=-(0.8-B1)*RAND()
 
B

Bernd

Hello,

Put into A1:
=-RAND()*1E14
and into B1:
=-A1+RAND()*(0.8-0.2)+0.2

You can substitute 1E14 by any smaller number > 0.

Regards,
Bernd
 
Top