averaging arrays

R

RobcPettit

Hi, I have an array called Runer which I redim(1 to 5, 1 to idex),
Idex bieng the number of times I count through certain scenarios. I
then use:
j = 1
For x = (UBound(Runner, 2) - (LowAve - 1)) To UBound(Runner, 2)
low(j) = Runner(1, x)
j = j + 1
Next x

this value (LowAve - 1) is the number of values I wish to average.
This works perfect, it takes the last 'x' values (15 here) in the
Runner array, column 1, and puts then into low(array). Im then using
Average = Application.WorksheetFunction.Average(low) to get the
Average. My question, is it possible to to do this directly with the
runner array and avoid tranfering the data to low array. Possibly
ending up with something like
Average = Application.WorksheetFunction.Average(Runner(the last 15
values in col 1)).
Regards Robert
 
G

Guest

this should happen so fast, that I can't see any reason to change it.

No, I doubt there is a direct way to do that with just available array
features.
 
R

RobcPettit

Thankyou for your answer. It happens fast enouhg for my needs. Nice to
know if I doing it efficiently though. Thankyou
Regards Robert
 

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

Top