> I want to be able to set conditions...
Describe your conditions.
To illustrate:
Lets say there are children ranging from ages 10 to 15, their ages are in column A1:A100.
Their height is listed in B1:B100.
If I want to know the rank of 5 feet tall kids in the series I do:
percentrank(b1:b100,5)
But what if I want to know the rank of 5 feet tall kids among only the 10 year old kids?
Idealy I would use this "imaginary" function "percentrankif"... I would do it like this: (Using the same format as sumif())
percentrankif(a1:a100,"=10",b1:b100,5)
So from a1:a100 the condition "= 10" would be used to isolate all the 10 year old kids, and in b1:b100 the percentrank would only include kids who's A Column says they are 10 years old. 5 (feet tall) is the number to find the rank of.
Any ideas on how I could get these results?
Maybe if I had the VBA code to percentrank, I could modify it to allow conditions... But I'm not much of a programmer, so I wouldnt know unless I tried. :)
-----------------------------
John,
Try:
=SUMPRODUCT((A1:A100=10)*(B1:B100<5))/(SUMPRODUCT((A1:A100=10)+0)-1)
Aladin
can be a bit simplified: =SUMPRODUCT((A1:A100=10)*(B1:B100<5))/(COUNTIF((A1:A100,10)-1)
It should be:
=SUMPRODUCT((A1:A100=10)*(B1:B100 < 5))/(COUNTIF(A1:A100,10)-1) Aladin ========