Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
sammus
 
Posts: n/a
Default newbie question on multi-dimensional array


Hi all,

I have a real lame question about multi-dimensional array operation.
Suppose I have defined a two-dimensional array "Array(10,10)". If I
want to use the Excel function "Average" to compute the average value
of Column, say 10, of that 2D array, is there any way to realize it? I
tried "Application.Average(Array(:,10))", but apparently the Excel
doesn't like that. (You can see I am a Matlab guy, so please don't
laugh at me:) )
Any comments are extremely welcome.


--
sammus


------------------------------------------------------------------------
sammus's Profile: http://www.excelforum.com/member.php...o&userid=33092
View this thread: http://www.excelforum.com/showthread...hreadid=529036

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Jim Cone
 
Posts: n/a
Default newbie question on multi-dimensional array

s,
'---------------------
Sub ArrayTest()
Dim i As Long
Dim j As Long
Dim arrNums() As Double
Dim arrCol As Variant

'11 columns
ReDim arrNums(0 To 10, 0 To 10)
'Fill the array
For i = 0 To 10
For j = 10 To 0 Step -1
arrNums(i, j) = i + j
Next
Next

'If you set row_num or column_num to 0 (zero), then
'Index returns the array of values for the entire column or row

arrCol = Application.Index(arrNums, 0, 10) 'next to last column
MsgBox Application.Average(arrCol)
End Sub
'------------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"sammus" wrote in message...
Hi all,
I have a real lame question about multi-dimensional array operation.
Suppose I have defined a two-dimensional array "Array(10,10)". If I
want to use the Excel function "Average" to compute the average value
of Column, say 10, of that 2D array, is there any way to realize it? I
tried "Application.Average(Array(:,10))", but apparently the Excel
doesn't like that. (You can see I am a Matlab guy, so please don't
laugh at me:) )
Any comments are extremely welcome.
sammus

  #3   Report Post  
Posted to microsoft.public.excel.newusers
sammus
 
Posts: n/a
Default newbie question on multi-dimensional array


Thank you so much for your enlightening reply. :)


--
sammus


------------------------------------------------------------------------
sammus's Profile: http://www.excelforum.com/member.php...o&userid=33092
View this thread: http://www.excelforum.com/showthread...hreadid=529036

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
Multicell Array Formula and List Question John Mansfield Excel Worksheet Functions 11 March 21st 05 01:36 AM
Newbie Question: Data/Sort [email protected] New Users to Excel 1 February 21st 05 11:37 PM
Newbie to charts question - projecting values between data points 38N90W Excel Discussion (Misc queries) 3 January 6th 05 05:15 AM
Newbie question Doh New Users to Excel 5 December 16th 04 09:31 PM
SUM array formula question Dan Excel Worksheet Functions 6 November 8th 04 05:49 AM


All times are GMT +1. The time now is 04:49 PM.

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"