Path: news.mathworks.com!not-for-mail
From: Ashish Uthama <first.last@mathworks.com>
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$1@fred.mathworks.com>
References: <i6tbnj$94h$1@fred.mathworks.com> <i6trc5$ob7$1@fred.mathworks.com>
Reply-To: first.last@mathworks.com
NNTP-Posting-Host: authama-deb5-64.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1284731474 22293 172.31.57.117 (17 Sep 2010 13:51:14 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 17 Sep 2010 13:51:14 +0000 (UTC)
User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)
In-Reply-To: <i6trc5$ob7$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:670895

Naresh,

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.