Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Using Conditional Sums/Averages on Arrays

I have two arrays that are 3D. Each dimension is populated within Three tier
For Next loop. The first array has data, the second array has dates
associated with its companion element in the first array:

DataArray1(0,0,0) and DateArray2(0,0,0) are related.

I want to Average and or SUM the column data from:
DataArray1(0,0,0) to DataArray1(1000,100,0)
using a conditional logic on the dates in the DateArray

I want to use something similar to the SUMPRODUCT formula using the unitary
operators "--". I am trying to avoid using Pivot Tables if possible.
Perhaps even a function would work.

Any ideas on how I do this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Conditional Sums/Averages on Arrays

In VBA, SUMPRODUCT can not be used as an array formula (which is what you
describe). You would need to pass a virtual formula to the evaluate method.
However, it won't work on a 3D array nor will anything slice a 2D array out
of a 3D array as a single command.

That said, looping through the array and building your own result should be
very fast.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
I have two arrays that are 3D. Each dimension is populated within Three

tier
For Next loop. The first array has data, the second array has dates
associated with its companion element in the first array:

DataArray1(0,0,0) and DateArray2(0,0,0) are related.

I want to Average and or SUM the column data from:
DataArray1(0,0,0) to DataArray1(1000,100,0)
using a conditional logic on the dates in the DateArray

I want to use something similar to the SUMPRODUCT formula using the

unitary
operators "--". I am trying to avoid using Pivot Tables if possible.
Perhaps even a function would work.

Any ideas on how I do this?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Using Conditional Sums/Averages on Arrays

"You would need to pass a virtual formula to the evaluate method."

If I were to do this, and my data was in a 2D array, what would this look
like? I have seen the Evaluate Method used with formulas relating to cells.
But as my data is in an array could I pursue the Evalutate method?




"Tom Ogilvy" wrote:

In VBA, SUMPRODUCT can not be used as an array formula (which is what you
describe). You would need to pass a virtual formula to the evaluate method.
However, it won't work on a 3D array nor will anything slice a 2D array out
of a 3D array as a single command.

That said, looping through the array and building your own result should be
very fast.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
I have two arrays that are 3D. Each dimension is populated within Three

tier
For Next loop. The first array has data, the second array has dates
associated with its companion element in the first array:

DataArray1(0,0,0) and DateArray2(0,0,0) are related.

I want to Average and or SUM the column data from:
DataArray1(0,0,0) to DataArray1(1000,100,0)
using a conditional logic on the dates in the DateArray

I want to use something similar to the SUMPRODUCT formula using the

unitary
operators "--". I am trying to avoid using Pivot Tables if possible.
Perhaps even a function would work.

Any ideas on how I do this?

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Conditional Sums/Averages on Arrays

No. Not unless it were very small any you could write the array out as you
would in a formula in a cell. I was really addressing the use of sumproduct
as an array formula in general. Again, looping through an array is
extremely fast.

--
Regards,
Tom Ogilvy


"ExcelMonkey" wrote in message
...
"You would need to pass a virtual formula to the evaluate method."

If I were to do this, and my data was in a 2D array, what would this look
like? I have seen the Evaluate Method used with formulas relating to

cells.
But as my data is in an array could I pursue the Evalutate method?




"Tom Ogilvy" wrote:

In VBA, SUMPRODUCT can not be used as an array formula (which is what

you
describe). You would need to pass a virtual formula to the evaluate

method.
However, it won't work on a 3D array nor will anything slice a 2D array

out
of a 3D array as a single command.

That said, looping through the array and building your own result should

be
very fast.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
I have two arrays that are 3D. Each dimension is populated within

Three
tier
For Next loop. The first array has data, the second array has dates
associated with its companion element in the first array:

DataArray1(0,0,0) and DateArray2(0,0,0) are related.

I want to Average and or SUM the column data from:
DataArray1(0,0,0) to DataArray1(1000,100,0)
using a conditional logic on the dates in the DateArray

I want to use something similar to the SUMPRODUCT formula using the

unitary
operators "--". I am trying to avoid using Pivot Tables if possible.
Perhaps even a function would work.

Any ideas on how I do this?

Thanks






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
Trying to make both averages AND sums of one spreadsheet of data E[_2_] Excel Discussion (Misc queries) 3 July 5th 09 11:29 PM
Trying to make averages AND sums of one spreadsheet of information E[_2_] Excel Worksheet Functions 0 June 30th 09 08:41 PM
Help with Averages/Sums of values returned from IF function TheBigUnit622 Excel Discussion (Misc queries) 7 March 3rd 09 05:38 PM
Arrays and Averages Stefi Excel Worksheet Functions 1 February 27th 09 04:17 PM
More Questions Sums and Averages by Date KevinGrogan Excel Discussion (Misc queries) 3 July 4th 07 11:46 PM


All times are GMT +1. The time now is 09:45 AM.

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

About Us

"It's about Microsoft Excel"