PC Review


Reply
Thread Tools Rate Thread

averaging arrays

 
 
RobcPettit
Guest
Posts: n/a
 
      22nd Feb 2007
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      22nd Feb 2007
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
>
>

 
Reply With Quote
 
RobcPettit
Guest
Posts: n/a
 
      22nd Feb 2007
Thankyou for your answer. It happens fast enouhg for my needs. Nice to
know if I doing it efficiently though. Thankyou
Regards Robert

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
averaging non-contiguous data using arrays Matt S Microsoft Excel Programming 1 2nd Jun 2009 09:13 PM
RE: VBA - averaging the difference of 2 arrays, ignoring blanks =?Utf-8?B?SyBEYWxlcw==?= Microsoft Excel Programming 0 8th Aug 2005 07:09 PM
Re: VBA - averaging the difference of 2 arrays, ignoring blanks Tom Ogilvy Microsoft Excel Programming 0 8th Aug 2005 06:54 PM
averaging specific rows in multiple arrays =?Utf-8?B?R0pSMzU5OQ==?= Microsoft Excel Worksheet Functions 2 3rd Mar 2005 12:24 PM
Averaging in arrays Tom Microsoft Excel Misc 5 20th Sep 2004 03:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:25 AM.