Excel: Ranking Number Range with Array FormulaID: Q65398
|
In Microsoft Excel, version 4.0, use the RANK function to rank a range of
numbers according to their numerical value. To rank the numbers from small
to large, where the small number is the first in rank, use the following
function:
=RANK(firstcell,range,-1)
=RANK(firstcell,range)
=ROWS(range)-SUM(IF(range>=firstcell,1,0))+1
(to rank from small to large)
=ROWS(range)-SUM(IF(range>firstcell,0,1))+1
(to rank from large to small)
The following formulas will return the correct ranking of the numbers in
cells $A$1:$A$5 (the braces {} indicate that the formula was entered as an
array by pressing COMMAND+ENTER in Microsoft Excel for the Macintosh or
CONTROL+SHIFT+ENTER in Microsoft Excel for Windows:
A1: 50 B1: {=ROWS($A$1:$A$5)-SUM(IF($A$1:$A$5>=A1,1,0))+1}
A2: 12 B2: {=ROWS($A$1:$A$5)-SUM(IF($A$1:$A$5>=A2,1,0))+1}
A3: 42 B3: {=ROWS($A$1:$A$5)-SUM(IF($A$1:$A$5>=A3,1,0))+1}
A4: 31 B4: {=ROWS($A$1:$A$5)-SUM(IF($A$1:$A$5>=A4,1,0))+1}
A5: 1 B5: {=ROWS($A$1:$A$5)-SUM(IF($A$1:$A$5>=A5,1,0))+1}
A1: 50 B1: 5
A2: 12 B2: 2
A3: 42 B3: 4
A4: 31 B4: 3
A5: 1 B5: 1
Additional query words: 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.0 2.00 2.01 2.20 2.21 3.0
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: July 14, 1999