View Single Post
  #5   Report Post  
RandomProblems
 
Posts: n/a
Default

Thank you for the insitefull response. I guess I am going to do some reading.

"arno" wrote:

Hi,

you need a macor for this. However, you'll always get the same result.
Run my code, in column A you'll see the sum you are looking for (250,
2500... 2.5Mio iterations), in column B you'll see the average, which
will always be the same.

Sub test()
Randomize
x = 0
v = 25
For j = 1 To 5
v = v * 10
For i = 1 To v
x = x + Rnd()
Next
Cells(j, 1).Value = x
Cells(j, 2).Value = x / v
Next j
End Sub

the important part for you is:
for i = 1 to 2500000
x = x+Rnd()
next

arno

"RandomProblems" schrieb im
Newsbeitrag ...
I need to create the sum of 2,500,000 iterations generated by the Rnd
generator function. I cannot create y=X(1)+X(2)+......X(n) where y

is the
sum and x (the first iteration, x(2) the second and so on.