Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Median, Percentile, MAX Based on Criteria From Another Column

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
Good morning. It's my Birthday and I've had to come in to work!!!! Brain's a bit fuzzy! :(

Anyway. Is it possible to obtain the Median, Percentile, MAX based on criteria from another column? Basically, every month we will be adding figures to a worksheet and will need to calculated Year To Date figures. The first column will be patients who have either been "Admitted" or "Non Admitted" following a visit to our Accident & Emergency Department (ED). The second column will be the length of time each patient spent in the Department. What I would like to be able to do is create a formula for each measure where currently this is amended monthly when new data are added, i.e.:

=PERCENTILE(B5:B1467,0.95) is the range of Admitted patients (so far)

=PERCENTILE(B1468:B5402,0.95) is the range of Non Admitted patients (so far)

So, is there any way to make the range dynamic like I could if I were just doing a total, e.g.

=SUMPRODUCT((A5:A50000="Admitted")*(B5:B50000))

=SUMPRODUCT((A5:A50000="Non Admitted")*(B5:B50000))



Many thanks,
D€$
 
Should I be looking at AGGREGATE?

Many thanks,
D€$
 
=AGGREGATE(14,6,(B5:B50000)*(A5:A50000="Non Admitted"),1) = "MAX"

=AGGREGATE(16,6,(B5:B50000)/(A5:A50000="Non Admitted"),0.95) = "Percentile"

Just got to get the syntax for Median,

Many thanks,
D€$
 
Oh, it appears as if it's the 50th Percentile that equals Median.

=AGGREGATE(16,6,(B5:B50000)/(A5:A50000="Non Admitted"),0.5)

Bit wired today as I only drink decaff but my colleagues bought me a cafetiere and some real coffee so it would have been rude not to use it! Chocolate cream cakes also adding to the caffeine quotiant!!

Many thanks,
D€$
 
Have you considered using structured table in Excel?

Also, you do know you can edit your own posts, right? :)

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Bottom right-hand corner of the post you want to edit.

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Was that prophetic?

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Hi Andy, this is data that's coming out of Business Objects so that's enough for our people to be going on with for now!! :)

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top