median array help

T

tmason

Hi there, this formula made into an array is not excluding empty cells
Any ideas?
{=MEDIAN(IF(A$2:A$50000=A2,IF(B$2:B$50000=B2,C$2:C$50000)))}

column A and column B are categories, column C is the number. I want th
median of all rows where a and b are equal, and c is not empty.

in this simple example with only one a+b combo, zy median should retur
the number 2. Using the array, it is returning 1.5

a b c
 
J

joeu2004

tmason said:
this formula made into an array is not excluding empty cells.
Any ideas?
{=MEDIAN(IF(A$2:A$50000=A2,IF(B$2:B$50000=B2,C$2:C$50000)))}

Array-enter the following formula (press ctrl+shift+Enter, not just Enter):

=MEDIAN(IF(A$2:A$50000=A2,IF(B$2:B$50000=B2,
IF(C$2:C$50000<>"",C$2:C$50000))))
 
T

tmason

figured it out

=MEDIAN(IF((A$2:A$50000=A2)*(B$2:B$50000=B2)*(C$2:C$50000<>""),C$2:C$50000)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top