Averaging adjacent Columns

  • Thread starter Srikanth Ganesan
  • Start date
S

Srikanth Ganesan

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!
 
J

Jim Thomlinson

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

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