Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAL PAL is offline
external usenet poster
 
Posts: 200
Default Arrays and Averages

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Arrays and Averages

Hi,

=AVERAGE(IF(B1:B20="US",C1:C20))

I think the average of 5+3 is 4 but perhaps that's just me :)

This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Arrays and Averages

and just because it's slow in here a non array version

=SUMPRODUCT((B1:B20="US")*(C1:C20))/COUNTIF(B1:B20,"US")

Mike

"Mike H" wrote:

Hi,

=AVERAGE(IF(B1:B20="US",C1:C20))

I think the average of 5+3 is 4 but perhaps that's just me :)

This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Arrays and Averages

Hi,

Suppose your data starts in A1:C99 with titles Items, Region, Units on the
first row

In a blank cell enter the title at the top of the Region column (in my
example F1) and under it the region you want to total, then use the formula:

=DSUM(A1:C99,C1,F1:F2)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Arrays and Averages

SUMPRODUCT is faster than array formulae, but not enough to worry about IMO.

But if you have interpreted the question correctly, there is no need to use
SUMPRODUCT, you can use the MUCH faster SUMIF

=SUMIF(B1:B20,"US",C1:C20)/COUNTIF(B1:B20,"US")


--
__________________________________
HTH

Bob

"Mike H" wrote in message
...
and just because it's slow in here a non array version

=SUMPRODUCT((B1:B20="US")*(C1:C20))/COUNTIF(B1:B20,"US")

Mike

"Mike H" wrote:

Hi,

=AVERAGE(IF(B1:B20="US",C1:C20))

I think the average of 5+3 is 4 but perhaps that's just me :)

This is an array formula which must be entered with CTRL+Shift+Enter and
NOT
'just enter. If you do it correctly then Excel will put curly brackets
around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for
the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Arrays and Averages

PAL wrote:
I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.


Hey PAL...instead of repeatedly posting the same question (6 times), maybe you
could respond to one of the many solutions you've been offered (12 posts by 7
people according to my count).
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Arrays and Averages

Bob,

I took all 3 formula, my 2 and yours and reset the ranges to 1 - 65535 and
filled down using the original OP data. I then Changed a single cell in the
sum range to force re-calculation and all the formula refreshed virtually
instantly.

How do I measure the diferenece in performance or would the formula need to
be more complicated to notice a difference?

Mike

"Bob Phillips" wrote:

SUMPRODUCT is faster than array formulae, but not enough to worry about IMO.

But if you have interpreted the question correctly, there is no need to use
SUMPRODUCT, you can use the MUCH faster SUMIF

=SUMIF(B1:B20,"US",C1:C20)/COUNTIF(B1:B20,"US")


--
__________________________________
HTH

Bob

"Mike H" wrote in message
...
and just because it's slow in here a non array version

=SUMPRODUCT((B1:B20="US")*(C1:C20))/COUNTIF(B1:B20,"US")

Mike

"Mike H" wrote:

Hi,

=AVERAGE(IF(B1:B20="US",C1:C20))

I think the average of 5+3 is 4 but perhaps that's just me :)

This is an array formula which must be entered with CTRL+Shift+Enter and
NOT
'just enter. If you do it correctly then Excel will put curly brackets
around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units for
the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Arrays and Averages

How do I measure the diferenece in performance

There is calculation timer code he

http://msdn2.microsoft.com/en-us/library/aa730921.aspx

Or, you can pick up a copy of Charles Williams FastExcel

http://www.decisionmodels.com/index.htm

--
Biff
Microsoft Excel MVP


"Mike H" wrote in message
...
Bob,

I took all 3 formula, my 2 and yours and reset the ranges to 1 - 65535 and
filled down using the original OP data. I then Changed a single cell in
the
sum range to force re-calculation and all the formula refreshed virtually
instantly.

How do I measure the diferenece in performance or would the formula need
to
be more complicated to notice a difference?

Mike

"Bob Phillips" wrote:

SUMPRODUCT is faster than array formulae, but not enough to worry about
IMO.

But if you have interpreted the question correctly, there is no need to
use
SUMPRODUCT, you can use the MUCH faster SUMIF

=SUMIF(B1:B20,"US",C1:C20)/COUNTIF(B1:B20,"US")


--
__________________________________
HTH

Bob

"Mike H" wrote in message
...
and just because it's slow in here a non array version

=SUMPRODUCT((B1:B20="US")*(C1:C20))/COUNTIF(B1:B20,"US")

Mike

"Mike H" wrote:

Hi,

=AVERAGE(IF(B1:B20="US",C1:C20))

I think the average of 5+3 is 4 but perhaps that's just me :)

This is an array formula which must be entered with CTRL+Shift+Enter
and
NOT
'just enter. If you do it correctly then Excel will put curly brackets
around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units
for
the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Arrays and Averages

Thanks Biff I'll look at that

"T. Valko" wrote:

How do I measure the diferenece in performance


There is calculation timer code he

http://msdn2.microsoft.com/en-us/library/aa730921.aspx

Or, you can pick up a copy of Charles Williams FastExcel

http://www.decisionmodels.com/index.htm

--
Biff
Microsoft Excel MVP


"Mike H" wrote in message
...
Bob,

I took all 3 formula, my 2 and yours and reset the ranges to 1 - 65535 and
filled down using the original OP data. I then Changed a single cell in
the
sum range to force re-calculation and all the formula refreshed virtually
instantly.

How do I measure the diferenece in performance or would the formula need
to
be more complicated to notice a difference?

Mike

"Bob Phillips" wrote:

SUMPRODUCT is faster than array formulae, but not enough to worry about
IMO.

But if you have interpreted the question correctly, there is no need to
use
SUMPRODUCT, you can use the MUCH faster SUMIF

=SUMIF(B1:B20,"US",C1:C20)/COUNTIF(B1:B20,"US")


--
__________________________________
HTH

Bob

"Mike H" wrote in message
...
and just because it's slow in here a non array version

=SUMPRODUCT((B1:B20="US")*(C1:C20))/COUNTIF(B1:B20,"US")

Mike

"Mike H" wrote:

Hi,

=AVERAGE(IF(B1:B20="US",C1:C20))

I think the average of 5+3 is 4 but perhaps that's just me :)

This is an array formula which must be entered with CTRL+Shift+Enter
and
NOT
'just enter. If you do it correctly then Excel will put curly brackets
around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike

"PAL" wrote:

I have a table 30 rows, 3 columns

Col A is product name (3 products)
Col B is region name (US)
Col C is # Unit for each product (5)

Example

Cars US 5
Trucks US 3
Cars Europe 6

How create a formula that will give me the average number of units
for
the
sum of the products in a given region.

Output in example should be (5+3)/2 =4.5

Thanks.







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
averages tommy Excel Discussion (Misc queries) 8 March 10th 10 09:15 PM
arrays and averages PAL Excel Worksheet Functions 1 February 13th 09 06:28 PM
Arrays, averages PAL Excel Worksheet Functions 1 February 13th 09 05:18 PM
first ten and last ten averages aazharr Excel Worksheet Functions 2 February 28th 08 03:28 PM
Averages Beth Excel Worksheet Functions 0 March 10th 06 03:33 PM


All times are GMT +1. The time now is 10:44 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"