PercentRankArray (Function)
The PercentRankArray function returns the rank of a value within an array as a percentage of the data set.
Syntax
PercentRankArray(PriceToRank, PriceArray, Size)
Returns (Double)
A numeric value the rank of a value in a data set as a percentage of the data set. The function will return -1 if the Size is greater than the referenced Array.
Parameters
|
Name |
Type |
Description |
|
PriceToRank |
Numeric |
Sets the value to rank within the specified array. |
|
PriceArray |
Numeric Array |
Specifies the name of a numeric array containing values upon which the rank iis calculated. |
|
Size |
Numeric |
Sets the number of data elements (size) in the array to evaluate. |
Remarks
This function can be used to evaluate the relative standing of a value within an array.
The value for the Size input parameter should always be a whole number greater than 0 and is typically equal to the number of data elements in the array.
The PercentRankArray function only works with one-dimensional arrays. All array-based referencing begins with array element 1.
Example
Assigns to Value1 the rank of a price value of 45 in a user defined array.
Array: myArray[30](0);
{… (assign values to array) }
Value1 = PercentRankArray(45,myArray, 30);