Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default averaging arrays

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default averaging arrays

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.

--
Regards,
Tom Ogilvy


"RobcPettit" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default averaging arrays

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with ranges in arrays... or an introduction to arrays Glen Excel Programming 5 September 10th 06 08:32 AM
Arrays - declaration, adding values to arrays and calculation Maxi[_2_] Excel Programming 1 August 17th 06 04:13 PM
Averaging best 15 out of 20? Rando Excel Discussion (Misc queries) 2 December 13th 05 10:01 PM
VBA - averaging the difference of 2 arrays, ignoring blanks RobPaolillo Excel Programming 4 August 8th 05 07:13 PM
averaging specific rows in multiple arrays GJR3599 Excel Worksheet Functions 2 March 3rd 05 12:24 PM


All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"