Compatibility
RANK
Matches all 6 recorded answers
Recorded: 6 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | RANK |
| Bulgarian | RANK |
| Czech | RANK |
| Danish | PLADS |
| German | RANK |
| Greek | RANK |
| English (Australia) | RANK |
| English (United Kingdom) | RANK |
| English (United States) | RANK |
| Spanish | JERARQUIA |
| Estonian | RANK |
| Finnish | ARVON.MUKAAN |
| French | RANG |
| Hebrew | RANK |
| Croatian | RANK |
| Hungarian | SORSZÁM |
| Indonesian | RANK |
| Italian | RANK |
| Japanese | RANK |
| Korean | RANK |
| Lithuanian | RANK |
| Latvian | RANK |
| Norwegian | RANGERING |
| Dutch | POSITIE |
| Polish | POZYCJA |
| Portuguese (Brazil) | CLASSIFICAÇÃO |
| Portuguese (Portugal) | ORDEM |
| Romanian | RANK |
| Russian | РАНГ |
| Slovak | PORADIE |
| Slovenian | RANK |
| Serbian (Latin) | RANGIRANJE |
| Swedish | RANG |
| Thai | RANK |
| Turkish | RANK |
| Ukrainian | RANK |
| Vietnamese | RANK |
| Chinese (Simplified) | RANK |
| Chinese (Hong Kong) | RANK |
| Chinese (Traditional) | RANK |
Names from Microsoft's support site.
What it does
RANK(number, ref, [order])
RANK(number,ref,[order]) returns a number’s position within numeric observations. The default order is descending, so the largest value has rank one; a nonzero order requests ascending rank. It is the compatibility spelling of the tied-equal rank.
Try it
With 30,20,20,10 in B2:B5, =RANK(20,B2:B5) returns 2. Both twenties have rank two and the ten has rank four: ties leave a gap.
Quirks
Text, logical values and blanks in the reference are ignored, while zeros and repeated numbers remain observations. Ties share their first occupied rank; they do not receive consecutive ranks or an average. A number absent from the admitted data gives #N/A in the current helper.
Microsoft describes any nonzero order as ascending. The current wrapper truncates its numeric order toward zero before testing it, so fractional flags between minus one and one select descending. That is an implementation rule, not a measured statement about every Excel build. A nonnumeric target is also #N/A in this wrapper; it is not automatically parsed from numeric-looking text.
How to implement
- Validate the target as the current wrapper does: preserve a numeric value or worksheet error; other target kinds give
#N/A. - Collect the reference’s numeric observations. Coerce and truncate a supplied order flag, then test zero versus nonzero.
- Confirm the target occurs. If it is absent, return
#N/A. - Descending rank is
1+count(value>target); ascending rank is1+count(value<target). Equal observations contribute no preceding positions, so each member of a tie receives the same result.
With 30,20,20,10, only thirty exceeds twenty, giving rank two. All three other observations exceed ten, giving rank four. In ascending order thirty is fourth rather than first.
For a single query, counting avoids sorting and uses exact comparisons of the admitted numeric values. A sorted index can support many queries, provided it retains multiplicities and the same equality rule. Pairing this function with ROW-based tie breakers produces unique positions, which is a different ranking convention.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
RANK · 1 lines · calc-func/src/catalogue/statistics.rs on GitHub11 rank_legacy "RANK" (2, 3) [V "number", F "ref", V "order"] |s, a, sv| { rank(s, a, sv, false) }
Kernels shared with other functions
listcatalogue/statisticsrank_numbercatalogue/statisticsrankcatalogue/statisticsrank_eqported/rank_commonrank_avgported/rank_common
Argument and result plumbing
No implementation has been published with a Handbook test suite for this function.
Version differences
No same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.
Alternatives
RANK.EQ makes this tie rule explicit; RANK.AVG averages tied positions; PERCENTRANK.INC returns fractional standing.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents