Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Averaging adjacent Columns


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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Averaging adjacent Columns

Sorry...=AVERAGE(IF(LEFT(A$1:Z$1, 1)="X", A2:Z2))


"Jim Thomlinson" wrote:

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!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Averaging adjacent Columns


Jim,

It does not seem to work. Please help. Thanks

Srikanth


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
averaging data in multiple columns brad1824 Excel Discussion (Misc queries) 6 March 26th 10 03:52 PM
Add cells on two adjacent rows but non-adjacent columns Eve Excel Worksheet Functions 14 October 20th 09 02:32 AM
averaging info from three columns AAS Excel Discussion (Misc queries) 5 May 29th 08 09:35 PM
Averaging Columns based on a Text String Gene Haines New Users to Excel 9 September 19th 06 03:16 AM
Averaging columns rhodesv New Users to Excel 1 December 16th 04 08:14 PM


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"