View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Averaging adjacent Columns

You don't need VBA. You can use an array formula similar to:

=AVERAGE(IF(LEFT(A$1:Z$1, 1)="X", B2:I2))

"Srikanth Ganesan" wrote:


Hi I have data in the following column format:

X Y X1 Y1 X3 Y3 ............ Average
1 3 5 2
34 2 0 4
. . .
. . .


There are many columns (X,Y,X1,Y1 ....) with numerical data in them. I
want to create two new column by name "Average X" & "Average Y". Column
"Average X" is the average of the X, X1 X2 X3.. columns. Column
"Average Y" is the average of the Y, Y1 Y2 Y3.. columns etc. How do I
write a macro to do this automatically. Please help.

Srikanth



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!