How do i compute the average value of 100 iterations?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to compute the avg of all 100 iteraions. I set the iterations in the
Tool->options->calculation->iteration. Now i need to compute the avg of all
100 iterations. Any help would be greatly appreciatted.
Thanks,
Il
 
Il,

You would need to use VBA to do the actual calc....

HTH,
Bernie
MS Excel MVP
 
Try something like the sub below, for a formula in cell A1.

HTH,
Bernie
MS Excel MVP

Sub Macro1()
Dim i As Integer
Dim mySum As Double

With Application
.Iteration = True
.MaxIterations = 1
End With

For i = 1 To 100
Range("A1").Calculate
mySum = mySum + Range("A1").Value
Next i

MsgBox "The average is " & mySum / 100

With Application
.Iteration = False
End With

End Sub
 
Thank you very much!!! it helped a lot

Bernie Deitrick said:
Try something like the sub below, for a formula in cell A1.

HTH,
Bernie
MS Excel MVP

Sub Macro1()
Dim i As Integer
Dim mySum As Double

With Application
.Iteration = True
.MaxIterations = 1
End With

For i = 1 To 100
Range("A1").Calculate
mySum = mySum + Range("A1").Value
Next i

MsgBox "The average is " & mySum / 100

With Application
.Iteration = False
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top