From: Ashish Uthama <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: replicating MS Excel percentrank formula
Date: Fri, 17 Sep 2010 09:51:14 -0400
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <i6vroi$lol$>
References: <i6tbnj$94h$> <i6trc5$ob7$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: 1284731474 22293 (17 Sep 2010 13:51:14 GMT)
NNTP-Posting-Date: Fri, 17 Sep 2010 13:51:14 +0000 (UTC)
User-Agent: Mozilla-Thunderbird (X11/20090707)
In-Reply-To: <i6trc5$ob7$>
Xref: comp.soft-sys.matlab:670895


Dividing by the max assumes that your data starts at 1. Maybe you need 
to use the range?
i.e if your data ranges from 5 - 50, the denominator should probably be:

     max(data(:,2) - min(data(:,2))

The repeated element handling is also a concern (I do not know what the 
'right' answer for your application might be).

Echoing Rogers comments:
>  As I have said, this is only a guess.  It would require many examples 
> to be sure of the details in Excel's logic, or preferably some adequate 
> documentation.