View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_4_] Alan Beban[_4_] is offline
external usenet poster
 
Posts: 171
Default RePost: Summing column in 5D Array

Yes, it is clearer. And with Harlan Grove's resizing code available to
your workbook, I believe the code I last posted will accomplish the goal
of your post. It basically resizes (and preserves) the array to
eliminate the last 3 dimensions after the first 2 dimensions data have
been reloaded, calculates the maximum of Column 9 of the corresponding
(at that point) 2 dimensional array data (hence the typical
......Index(Array1,0,9) structure), then resizes (and preserves) the
array to 5 dimensions for the loops to complete the loading. At least
that's what I think it does, and that's what I think you want it to do.

So what's next?

Alan Beban

ExcelMonkey < wrote:
Sorry for any ambiguity in my description. I will tell you exactly what
I am doing. I am looking at ouput costs for industrial equipment. The
pieces of equipment make up dimesion 1 (to 13). The second dimension
(i.e. the columns) are the different elements of costs associated with
each piece of equipment. Column 9 is the total costs column. The
remaining dimensions are time and stochastic variables. Dimension 3 is
hours, Dimension 4 is years and Dimension 5 is for stochastic runs
(i.e. 5 different runs)

Do I want in every hour to find out which piece of equipment has the
highest cost. I apologize I said "Summing" when I meant to say Maxing.
And I want to calculate this at the end of every hour. So when the
looping is completed, I will have the max equipment cost across 13
pieces of equipment. And since I do this every hour, I will be able to
look at this data across hours, years, and multiple stocahstic runs.
So my statement:

ArrayMax = Application.Max(Application.Index(Array1, 0, 9, 0, 0, 0))

was my attempt to record the highest value in column 9 before advancing
to the next hour loop. I will eventually store this value in another
array and when the run is completed I will have max cost data for
#hours*#years*stochastic runs.

Is that any clearer?


---
Message posted from http://www.ExcelForum.com/