Median with Criteria

D

Demosthenes

Hello,

I want to write a formula that calculates the median of a set of values
specified by some criteria. For example, if you have the following in A and B:

1 1
1 2
2 3
1 7
2 6
1 8
1 9
2 4
2 3
2 4
1 5
1 6
2 3

I want to calculate the median of the values in column B that have a 1 in
column A (in this case, median = 6). Does anyone have a good idea for how to
do that?

Thanks,
 
M

Mike H

Hi,

Try this ARRAY formula

=MEDIAN(IF(A1:A13=1,B1:B13))

This is an array formula which must be entered by pressing 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 formula
you must enter it again with CTRL+Shift+Enter.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

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