Function Math Statistics Class

PercentRank

Returns the rank of a value as a percentage of the values in the data set. Inverse of the Percentile function.

Signature (Visual Basic / VBA)

Public Function PercentRank( _
      ByVal vN As Variant _
    , ParamArray vValues() As Variant _
    ) As Variant

Code Example

    PercentRank(12, 12, 34, 56) = 0.00
    PercentRank(23, 12, 34, 56) = 0.25
    PercentRank(34, 12, 34, 56) = 0.50
    PercentRank(45, 12, 34, 56) = 0.75
    PercentRank(56, 12, 34, 56) = 1.00

Parameters

Parameter Description
vN The value whose corresponding percentile will be returned. Must be between the minimum and maximum values in vValues inclusive.
vValues The values that are to be processed. Can be numbers, one-dimensional numeric arrays, one-dimensional Variant arrays, one-dimensional Variant arrays with embedded arrays, or any combination of these. The current setting of the StatVarType Property determines which numeric data types are recognized by this function.

Return Value

Function returns the percent rank of the value vN, or it will use interpolation to determine the percent rank if vN is not a value in vValues. Function returns Null if none of the vValues arguments are numeric, or if vN is not between the minimum and maximum values in vValues inclusive.