Difference between revisions of "Documentation/How Tos/Calc: RANK function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (See also:: PERCENTRANK)
m
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:RANK function}}
 +
{{Documentation/CalcFunc StatisticalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_QUARTILE_function
 +
|NextPage=Documentation/How_Tos/Calc:_SMALL_function
 +
}}__NOTOC__
  
 
== RANK ==
 
== RANK ==
Line 20: Line 25:
 
<tt>'''RANK(5; {3;5|2.6;1}; 1)'''</tt>
 
<tt>'''RANK(5; {3;5|2.6;1}; 1)'''</tt>
 
: returns <tt>'''4'''</tt>, as the other three numbers are lower than <tt>'''5'''</tt>.
 
: returns <tt>'''4'''</tt>, as the other three numbers are lower than <tt>'''5'''</tt>.
 
=== See also: ===
 
[[Documentation/How_Tos/Calc: LARGE function|'''LARGE''']],
 
[[Documentation/How_Tos/Calc: SMALL function|'''SMALL''']],
 
[[Documentation/How_Tos/Calc: MAX function|'''MAX''']],
 
[[Documentation/How_Tos/Calc: MIN function|'''MIN''']],
 
[[Documentation/How_Tos/Calc: PERCENTRANK function|'''PERCENTRANK''']]
 
 
[[Documentation/How_Tos/Calc: Statistical functions|'''Statistical functions''']]
 
  
 
===Issues: ===
 
===Issues: ===
 
* By design, <tt>'''RANK'''</tt> returns the same rank for any value that is repeated in <tt>'''numberlist'''</tt>. If you wish a unique rank for each number in (say) <tt>'''A1:A4'''</tt>, enter <tt>'''=RANK(A1;$A$1:$A$4)+COUNTIF($A$1:A1;A1)-1'''</tt> in cell <tt>'''B1'''</tt> and copy/paste into <tt>'''B2:B4'''</tt>.
 
* By design, <tt>'''RANK'''</tt> returns the same rank for any value that is repeated in <tt>'''numberlist'''</tt>. If you wish a unique rank for each number in (say) <tt>'''A1:A4'''</tt>, enter <tt>'''=RANK(A1;$A$1:$A$4)+COUNTIF($A$1:A1;A1)-1'''</tt> in cell <tt>'''B1'''</tt> and copy/paste into <tt>'''B2:B4'''</tt>.
* Calc assumes that any logical values are <tt>'''1'''</tt> (<tt>'''TRUE'''</tt>) and <tt>'''0'''</tt> (<tt>'''FALSE'''</tt>). Excel's behaviour with logical values may be 'unexpected'.
+
* Calc assumes that any logical values are <tt>'''1'''</tt> (<tt>'''TRUE'''</tt>) and <tt>'''0'''</tt> (<tt>'''FALSE'''</tt>). Excel's behavior with logical values may be 'unexpected'.
 +
 
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: LARGE function|LARGE]]
 +
* [[Documentation/How_Tos/Calc: SMALL function|SMALL]]
 +
* [[Documentation/How_Tos/Calc: MAX function|MAX]]
 +
* [[Documentation/How_Tos/Calc: MIN function|MIN]]
 +
* [[Documentation/How_Tos/Calc: PERCENTRANK function|PERCENTRANK]]
 +
 
 +
* [[Documentation/How_Tos/Calc: Statistical functions|Statistical functions]]
 +
 
 +
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Statistical functions]]

Latest revision as of 14:55, 2 February 2024



RANK

Returns the rank of a number in a list of numbers.

Syntax:

RANK(number; numberlist; order)

returns the rank of number within the unordered range or array of numbers numberlist.
If order is zero or omitted, numbers are ranked with the highest being first; if order is non-zero, numbers are ranked with the lowest being first.
An error results if number is not present in numberlist.

Example:

RANK(5; B1:B4)

where cells B1, B2, B3, B4 contain 4, 7, 5,and 8, returns 3. The highest number is 8, then 7, then in third place 5.

RANK(5; {3;5|2.6;1}; 1)

returns 4, as the other three numbers are lower than 5.

Issues:

  • By design, RANK returns the same rank for any value that is repeated in numberlist. If you wish a unique rank for each number in (say) A1:A4, enter =RANK(A1;$A$1:$A$4)+COUNTIF($A$1:A1;A1)-1 in cell B1 and copy/paste into B2:B4.
  • Calc assumes that any logical values are 1 (TRUE) and 0 (FALSE). Excel's behavior with logical values may be 'unexpected'.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_RANK_function&oldid=260088"
Views
Personal tools
Navigation
Tools