RANK

The RANK function returns the rank of a value within a set of numeric values.

RANK(value, value-set, largest-is-high)

value: The number value, date/time value, or duration value to rank.

value-set: A collection of number values, date/time values, or duration values. All values must be of the same value type and also the same value type as value.

largest-is-high: An optional modal value specifying whether the smallest or the largest value in the collection is ranked 1.

largest is low (0, FALSE, or omitted): Assign the largest value in the collection the rank 1.

largest is high (1, or TRUE): Assign the smallest value in the collection the rank 1.

Notes

Examples

Suppose the following table contains the cumulative test scores for this semester for your 20 students. (The data is organized this way for the example; it would likely originally have been in 20 separate rows.)

A

B

C

D

E

1

30

75

92

86

51

2

83

100

92

68

70

3

77

91

86

85

83

4

77

90

83

75

80

=RANK(30, A1:E4, 1) returns 1, because 30 is the smallest cumulative test score and largest-is-high is 1 (rank the smallest value as the first value).

=RANK(92, A1:E4, 0) returns 2, because 92 is the second-largest cumulative test score and largest-is-high is 0 (rank the largest value as the first value).

=RANK(91, A1:E4, 0) returns 4, because there is a “tie” for second place. The order is 100, 92, 92, then 91 and the rank is 1, 2, 2, and then 4.

See also
LARGE
SMALL