ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   average using two criteria (https://www.excelbanter.com/excel-worksheet-functions/236339-average-using-two-criteria.html)

dj

average using two criteria
 
I am trying to average using 2 criteria. In column A I have gender as M or F.
In Column B I have ethnicity as A, W etc. In column C I have levels from -2
to 4. I want to average column C where column A = M and Column B = A. I don't
want to include in the average range a M if it does not have a corresponding
level in column C. I have used =AVERAGE(IF((gen="M")*(eth="A"),level)) as an
array (eg entering the above formula and then entering CTRL + SHIFT + Enter
rather than just enter). SO basically I wanted to know how to add the extra
condition to average only if it has M in column A, A in coumn B and a level
in Column C.

Hope this makes sense!


Jacob Skaria

average using two criteria
 
Try array formula

=AVERAGE(IF((A2:A10="m")*(C2:C10="a")*(M2:M10<"") ,M2:M10))

If this post helps click Yes
---------------
Jacob Skaria


"DJ" wrote:

I am trying to average using 2 criteria. In column A I have gender as M or F.
In Column B I have ethnicity as A, W etc. In column C I have levels from -2
to 4. I want to average column C where column A = M and Column B = A. I don't
want to include in the average range a M if it does not have a corresponding
level in column C. I have used =AVERAGE(IF((gen="M")*(eth="A"),level)) as an
array (eg entering the above formula and then entering CTRL + SHIFT + Enter
rather than just enter). SO basically I wanted to know how to add the extra
condition to average only if it has M in column A, A in coumn B and a level
in Column C.

Hope this makes sense!


dj

average using two criteria
 
Thanks! That is FAB and v speedy!

:o)

"Jacob Skaria" wrote:

Try array formula

=AVERAGE(IF((A2:A10="m")*(C2:C10="a")*(M2:M10<"") ,M2:M10))

If this post helps click Yes
---------------
Jacob Skaria


"DJ" wrote:

I am trying to average using 2 criteria. In column A I have gender as M or F.
In Column B I have ethnicity as A, W etc. In column C I have levels from -2
to 4. I want to average column C where column A = M and Column B = A. I don't
want to include in the average range a M if it does not have a corresponding
level in column C. I have used =AVERAGE(IF((gen="M")*(eth="A"),level)) as an
array (eg entering the above formula and then entering CTRL + SHIFT + Enter
rather than just enter). SO basically I wanted to know how to add the extra
condition to average only if it has M in column A, A in coumn B and a level
in Column C.

Hope this makes sense!



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com