Thread
:
Generation of random numbers and sum of those with a condition
View Single Post
#
9
ramana
Posts: n/a
Hi joeu,
Thank you verymuch showing interest in solving the problem. The
formula you gave at the last session is very useful and came closer to
solve the problem. But the one thing I wanted to refine is I need real
numbers at least with two decimal points. I could get the real numbers
generated by RAND()*(x-y)+y formula but not by RANDBETWEEN formula. By
this I could able to generate real numbers only in the column A and C
but not in B. But I need The column B also should be real numbers not
integers.
Thaks and Best Regards
Ramana
wrote:
ramana wrote:
I have three columns A,B&C In the column A Iwill generate
random numbers between 40&50, In the Column B I will
generate random numbers between 35&45, The column C is
the sum of Column A&B(i.e. C=A+B) but I the sum should
be between 83&88. I need acondition such that the random
numbers generated in Column A&B Should satisfy the Column C(A+B)
Okay, I think the following will do what you want:
A1: =RANDBETWEEN(40,50)
B1: =RANDBETWEEN(MAX(35,83-A1),MIN(45,88-A1))
C1: =A1+B1
That is based on the following table that fits your
constraints:
A minB maxB
40 43 45
41 42 45
42 41 45
43 40 45
44 39 44
45 38 43
46 37 42
47 36 41
48 35 40
49 35 39
50 35 38
See the caveats in my previous message regarding integer
v. non-integer requirements and how to install or substitute
for RANDBETWEEN.
Reply With Quote