A Question Concerning The Percentile Rank Function In Excel 2007
I have a two part question concerning Excel’s PercentileRank function.
1. How do I deal with #N/A returns? Every example I’ve found through Google searches provides code for dealing with a #N/A return when using VLOOKUP.
2. Most importantly, why do I get that at all? I have thirteen columns representing metrics and I need to percentrank. I have a total of 2, 438 rows for the thirteen different metrics (which in the real world represents individual medical practices)
Some columns will give me a valid return for all 2,438 rows and some will give me #N/A for all 2,438 rows. I’ve attached a sample which represents my problem.
Is this a data issue or a lack of understanding on my part regarding how PercentileRank works issue?
Re: A Question Concerning The Percentile Rank Function In Excel 2007
Hack,
I believe you are getting N/A when the range of your data in any given column does not include the number 2, since that's what your formula is trying to rank.
I'm thinking you want this instead:
Code:
=PERCENTRANK(myrange,A4)
so you can rank the value in a given cell compared to your overall list.
Re: A Question Concerning The Percentile Rank Function In Excel 2007
as i am not totally sure of your desired result, i may be totally incorrect, but it would appear to me that always asking for the rank position of 2, for each row, in a reducing range is probably not going to produce an appropriate result
at a brief look, column A values are all less than 2, so no result, changing any one cell to a value greater than 2 will give actual values for the formula, where referencing the changed cell, as the change cell is the only one above 2, the formula result would always be 1.00
Last edited by westconn1; Mar 15th, 2012 at 03:59 PM.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: A Question Concerning The Percentile Rank Function In Excel 2007
With function PERCENTRANK(array, x, [significance]):
If x < Min(array) or x > Max(array), the function will return #N/A.
In other words, you must have Min(array) <= x <= Max(array).
Re: A Question Concerning The Percentile Rank Function In Excel 2007
@Spoo: You are right...it is PERCENTRANK - these business types around here refer to it as a "percentile ranking" and I think I got "asimalated"
@anhn: Thanks...I did find that IF statement (eventually) that assisted me in dealing with the #N/A problem.
@vbfbryce & westconn1: The rank positioning thing seems to have been what was causing me all my angst. I've got more testing to do, but I think your suggestions were just the ticket.