View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
matelot matelot is offline
external usenet poster
 
Posts: 72
Default Using function with Arrays

I have 2 columns where I read into an array and I want to be able to
calculate the average of column 1 and column 2 separately. Is there a way to
do that in Excel? the current solution is to do a loop from 2 dim to 1 dim.
But I am sure Excel has a faster way to read the array. Thanks for your
comments.

arr = Range("A1:B5").value
avg1= application.worksheetfunction.average(arr(1)) <-refer to column 1
avg2 = application.worksheetfunction.average(arr(2)) <- refer to column 2