Documentation/Calc Functions/RANK.AVG

Function name:
RANK.AVG

Category:
Statistical Analysis

Summary:
Calculates the rank of a given value within a supplied list of numbers. The rank of a number is its size relative to other values in the list; this means that if you sort the list, a number’s rank is its position within the sorted list. If there are duplicate values in the list, the average rank is returned.

Syntax:
RANK.AVG(Value; Data[; Type])

Returns:
Returns an integer value which is the rank of the Value in the given Data with given sequence order Type. It ranges from 1 to the number of elements in Data.

Arguments:
Value is a real number or a reference to the cell containing that number which is the value whose rank is to be determined.

Data is the array or a reference to a range of cells containing the list of real numbers from which Value's rank is to be determined.

Type is the sequence order. Type = 0 means descending from the last item of the array to the first (this is the default), Type = 1 means ascending from the first item of the range to the last.


 * If a number in Data occurs more than once it is given the average rank of all the same numbers.
 * If Value does not exist in the range of Data then the function returns a value (#VALUE!) error.
 * If Type is any real number other than 0 or 1 then the function returns -1 for valid values of other arguments.
 * If Data contains a string (passed in double-quotes in an array and directly when passed as reference) then the function returns -1 else for all non-real numbers, the function returns an error value.

Related LibreOffice functions:
[[Special:MyLanguage/Documentation/Calc_Functions/RANK RANK]

[[Special:MyLanguage/Documentation/Calc_Functions/RANK.EQ RANK.EQ]

ODF standard:
None

Equivalent Excel functions:
RANK.AVG