In excel there is a function called PERCENTRANK, which accepts an array and a value as input.
Is there a way we can write similar function in ASP?
There is no function by that name, but is is easy to write functions in asp.
What is the function to do? return the position of the value within the array? return the value / the summed values within the array?
Function PercentRank (ary, inValue)
' Your code goes here.
' assuming that it is to return the position of the value inside the array...
' note that there is no error handling, (in case the paramater ary is not an array, for instance.)
for N = lbound(ary) to ubound(ary)
if inValue < ary(n) then
PercentRank = N/ubound(ary)
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert