Calculating Median's with Multiple Conditions

dmillerssa

New Member
Joined
Jun 26, 2012
Messages
6
Hi:

Quick issue I'm hoping someone can help me with.

Since the Pivot function lacks a median calculation, I need to calculate some median's based off three conditions in a data sheet.

I found working formulas for 2 conditions, but not three.

Here is what the data like:

A B C D
1 PUG 2010 January 21.1


D would represent the column I need to calculate the median off off. A, B, C are the conditional columsn.

Any help on this formula?

Thank you!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try an "array formula" like this

=MEDIAN(IF((A2:A100=1)*(B2:B100="PUG")*(C2:C100="2010 January"),D2:D100))

confirmed with CTRL+SHIFT+ENTER

You can use cells to contain the criteria if you want.......
 
Upvote 0
=median(if(and(a:a=1,b:b="pug",c:c="january"),d:d)) <--entered as an array (ctrl +shift+enter)
 
Upvote 0
OK I will give these options a try now. I was using a formula similar to what Barry suggested, but perhaps I made an error. I will let you guys know! Thanks.
 
Upvote 0
=median(if(and(a:a=1,b:b="pug",c:c="january"),d:d)) <--entered as an array (ctrl +shift+enter)

This won't work correctly, pplstuff. You can't use AND in these scenarios because AND returns a single result rather than the required array of results, you have to use * as I did to get the equivalent of AND, or use multiple IFs like this

=MEDIAN(IF(A2:A100=1,IF(B2:B100="PUG",IF(C2:C100="2010 January",D2:D100))))
 
Upvote 0
Hmmm...no luck with either formula. Barry, your formula worked fine on two conditions, but not there.
Here is the formula I'm using: =MEDIAN(IF(('Data-All'!D:D='Analysis-Time & Cost Perform.'!C96)*('Data-All'!T:T='Analysis-Time & Cost Perform.'!C97)*('Data-All'!U:U='Analysis-Time & Cost Perform.'!C98),'Data-All'!W:W)) then of course closing it out w CTRL+ALT-ENTER
 
Upvote 0
It works for the "2010" and the "January" timeline-but not when I add in this "PUG" value (PS, I built reference cells for all three values, and everything is formatted as 'General').
 
Upvote 0
So this works....=MEDIAN(IF(('Data-All'!T:T='Analysis-Time & Cost Perform.'!C97)*('Data-All'!U:U='Analysis-Time & Cost Perform.'!C98),'Data-All'!W:W))

But not when I add the third condition at the front (it comes first in the data-sheet).
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,629
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top