Excel RANK function
The RANK function in Excel returns the order (or rank) of a numeric value compared
to other values in the same list. In other words, it tells you which value is the
highest, the second highest, etc.
In a sorted list, the rank of a certain number would be its position. The RANK
function in Excel can determine the rank starting with the largest value (as if sorted
in descending order) or the smallest value (as if sorted in ascending order).
The syntax of the Excel RANK function is as follows:
RANK(number,ref,[order])
Where:
Number (required) - the value whose rank you'd like to find.
Ref (required) - a list of numeric values to rank against. It can be supplied as an
array of numbers or a reference to the list of numbers.
Order (optional) - a number that specifies how to rank values:
If 0 or omitted, the values are ranked in descending order, i.e. from largest to
smallest.
If 1 or any other non-zero value, the values are ranked in ascending order,
i.e. from smallest to largest.