Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default AVERAGE / STD of groups in a table?

I have a list of differerent-sized groups and values in a table. I am
trying to determine the Average and Stdev for each group. The formula
would need to reference the entire data range since the number of data
points in each group is continually changes.

For example in Col A1:B8 ....


Col A Col B
Group 1 500
Group 1 230
Group 1 102
Group 1 402
Group 2 300
Group 2 222
Group 3 134
Group 3 153

On the spreadsheet level, I can do a formula like:

=AVERAGE(IF(A1:A8="Group 1",B1:B8))
(entered as an array formula)

Is there a way to do a similar one-liner in VBA to get the same
results? I can't figure out how to enter an "array" type formula in
VBA.

Thanks.


John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default AVERAGE / STD of groups in a table?

VBA does not have array formulas, but Evaluate() will pass a string to Excel
for evaluation as an array formaula, thus
Evaluate("AVERAGE(IF(A1:A8=""Group 1"",B1:B8))")
would work.

Jerry

"robotman" wrote:

I have a list of differerent-sized groups and values in a table. I am
trying to determine the Average and Stdev for each group. The formula
would need to reference the entire data range since the number of data
points in each group is continually changes.

For example in Col A1:B8 ....


Col A Col B
Group 1 500
Group 1 230
Group 1 102
Group 1 402
Group 2 300
Group 2 222
Group 3 134
Group 3 153

On the spreadsheet level, I can do a formula like:

=AVERAGE(IF(A1:A8="Group 1",B1:B8))
(entered as an array formula)

Is there a way to do a similar one-liner in VBA to get the same
results? I can't figure out how to enter an "array" type formula in
VBA.

Thanks.


John


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
weighted avg. of groups in table dkingston Excel Programming 2 September 28th 06 11:44 PM
Pivot Table Groups Chris Excel Worksheet Functions 2 February 24th 06 06:42 AM
pivot table and groups tysop Excel Worksheet Functions 1 January 24th 06 06:33 PM
average and stdev from groups of data Charlie Excel Worksheet Functions 2 January 9th 06 03:56 AM
MAX, MIN, MEAN, AVERAGE, MODE for multiple groups...how? || cypher || Excel Worksheet Functions 2 July 14th 05 06:44 PM


All times are GMT +1. The time now is 09:15 AM.

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"