Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multicell Array Formula and List Question | Excel Worksheet Functions | |||
Newbie Question: Data/Sort | New Users to Excel | |||
Newbie to charts question - projecting values between data points | Excel Discussion (Misc queries) | |||
Newbie question | New Users to Excel | |||
SUM array formula question | Excel Worksheet Functions |