Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Average / sumproduct based on multiple criteria

Hi guys,

I have 3 columns. Column A contains the category lables "cat",
"dog","goldfish","mouse", column B contains a further category lable, ie 1,
2, 3, or 4 depending on their assigned grade, and column C contains a
variable value.

I need to average the variable values in column C only if they meet two of
the specific criteria in Columns A and B.

For example only average the values in column C where Column A contains cat
and column B contains the number 1.

The people on this forum have been invaluable to me for my problems with
excel so many thanks in advance.

kind regards,

Ant
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Average / sumproduct based on multiple criteria

Sorry, I forgot to add.... the criteria number to be used from column B is
stipulated in cell A2. So for example if cell A2 contains the number 1 then I
need the average of the values where column A cotains "Cat" and column B
contains 1. If cell A2 contains the number 2 I need the average of the values
where column A cotains "Cat" and column B contains the number 2, and so forth.

Sorry for this oversight, and many thanks again.

Kind regards,

Anthony

"Anto111" wrote:

Hi guys,

I have 3 columns. Column A contains the category lables "cat",
"dog","goldfish","mouse", column B contains a further category lable, ie 1,
2, 3, or 4 depending on their assigned grade, and column C contains a
variable value.

I need to average the variable values in column C only if they meet two of
the specific criteria in Columns A and B.

For example only average the values in column C where Column A contains cat
and column B contains the number 1.

The people on this forum have been invaluable to me for my problems with
excel so many thanks in advance.

kind regards,

Ant

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default Average / sumproduct based on multiple criteria

=AVERAGE(IF((A4:A12="cat")*(B4:B12=A2),C4:C12))
It is an *array* formula. Enter it with Ctrl+Shift+enter.
Change the ranges according to your requirement.
Best wishes
Sreedhar
"Anto111" wrote:

Sorry, I forgot to add.... the criteria number to be used from column B is
stipulated in cell A2. So for example if cell A2 contains the number 1 then I
need the average of the values where column A cotains "Cat" and column B
contains 1. If cell A2 contains the number 2 I need the average of the values
where column A cotains "Cat" and column B contains the number 2, and so forth.

Sorry for this oversight, and many thanks again.

Kind regards,

Anthony

"Anto111" wrote:

Hi guys,

I have 3 columns. Column A contains the category lables "cat",
"dog","goldfish","mouse", column B contains a further category lable, ie 1,
2, 3, or 4 depending on their assigned grade, and column C contains a
variable value.

I need to average the variable values in column C only if they meet two of
the specific criteria in Columns A and B.

For example only average the values in column C where Column A contains cat
and column B contains the number 1.

The people on this forum have been invaluable to me for my problems with
excel so many thanks in advance.

kind regards,

Ant

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Average / sumproduct based on multiple criteria

One way

Assume data within A3:C8, with criteria for col B in A2 (as posted)

In D3, array-entered*:
=AVERAGE(IF((A$3:A$8=A3)*(B$3:B$8=$A$2),C$3:C$8))
Copy down

If you need an error-trap to return blanks,
use this in D3, array-entered*:
=IF(ISERROR(AVERAGE(IF((A$3:A$8=A3)*(B$3:B$8=$A$2) ,C$3:C$8))),"",AVERAGE(IF((A$3:A$8=A3)*(B$3:B$8=$A $2),C$3:C$8)))

*To array-enter means to press CTRL+SHIFT+ENTER to confirm the formula

Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
Downloads: 15,500, Files: 352, Subscribers: 53
xdemechanik
---
"Anto111" wrote:
Sorry, I forgot to add.... the criteria number to be used from column B is
stipulated in cell A2. So for example if cell A2 contains the number 1 then I
need the average of the values where column A cotains "Cat" and column B
contains 1. If cell A2 contains the number 2 I need the average of the values
where column A cotains "Cat" and column B contains the number 2, and so forth.

Sorry for this oversight, and many thanks again.

Kind regards,

Anthony

"Anto111" wrote:

Hi guys,

I have 3 columns. Column A contains the category lables "cat",
"dog","goldfish","mouse", column B contains a further category lable, ie 1,
2, 3, or 4 depending on their assigned grade, and column C contains a
variable value.

I need to average the variable values in column C only if they meet two of
the specific criteria in Columns A and B.

For example only average the values in column C where Column A contains cat
and column B contains the number 1.

The people on this forum have been invaluable to me for my problems with
excel so many thanks in advance.

kind regards,

Ant

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
need to average based on criteria drd Excel Discussion (Misc queries) 2 May 30th 08 10:17 PM
average one column based on criteria from another ba374 Excel Discussion (Misc queries) 1 October 2nd 07 05:39 PM
IF-based SUMPRODUCT criteria creativeops Excel Discussion (Misc queries) 4 January 18th 07 05:36 PM
Calculating an average based on 2 and 3 criteria craggergirl Excel Worksheet Functions 2 February 24th 06 02:37 PM
caluculate an average based on 2 criteria [email protected] Excel Discussion (Misc queries) 3 November 3rd 05 03:34 AM


All times are GMT +1. The time now is 05:51 PM.

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

About Us

"It's about Microsoft Excel"