<-- Previous || Up || Next -->

Rank Function
Math Statistics Class

Public Function Rank( _
      ByVal vN As Variant _
    , ByVal vAscending As Boolean _
    , ParamArray vValues() As Variant _
    ) As Variant

Returns the rank of the number vN within the numbers in vValues.
vAscending determines how the numbers in vValues are sorted to determine the rank of vN.

Examples:
    Rank(12, True, 12, 34, 34, 56) = 1
    Rank(34, True, 12, 34, 34, 56) = 2
    Rank(34, False, 12, 34, 34, 56) = 2
    Rank(12, False, 12, 34, 34, 56) = 4
See also:
    PercentRank Function
    Percentile Function
    Quartile Function
    TrimMean Function
    Small Function
    Large Function
    RANK Function (Microsoft Excel)
vN: The value whose rank will be returned. Must be one of the numeric values in vValues.
vAscending: True if the numeric values in vValues should be sorted in ascending order, or False if they should be sorted in descending order.
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. Duplicate numbers in vValues are assigned the same rank.
Return value: Function returns the rank of the value vN within vValues when the numbers in vValues are sorted according to vAscending. Function returns Null if vN is not one of the numeric values in vValues.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.