Rank without skipping numbers after a tie (dense rank)
Updated · Checked on a live sheet · Excel and Google Sheets
The formula
=SUMPRODUCT((E$2:E$11>E2)/COUNTIF(E$2:E$11,E$2:E$11))+1 gives a dense rank: tied values share a rank and the next value gets the next number, with no gap. It counts how many different values are bigger than this one, then adds 1. Fill it down the column.
In general: =SUMPRODUCT((range>value)/COUNTIF(range,range))+1
Try it on a live sheet
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Name | Dept | Started | Born | Salary | Level | Dense rank |
| 2 | Amara Osei | Sales | 15 Apr 2019 | 2 Aug 1990 | $58,000 | 2 | 5 |
| 3 | Ben Fischer | Support | 9 Jan 2023 | 21 Nov 1996 | $41,000 | 1 | 8 |
| 4 | Lina Chen | Engineering | 1 Sep 2016 | 14 Mar 1987 | $88,000 | 4 | 1 |
| 5 | Diego Alvarez | Sales | 28 Jun 2021 | 30 Jun 1993 | $52,000 | 2 | 6 |
| 6 | Eva Novak | Finance | 12 Feb 2018 | 5 Dec 1985 | $74,000 | 3 | 3 |
| 7 | Farid Haddad | Engineering | 4 Mar 2024 | 19 Jan 1998 | $68,000 | 2 | 4 |
| 8 | Grace Kim | Support | 19 Oct 2020 | 27 Sep 1991 | $45,000 | 2 | 7 |
| 9 | Hugo Martin | Finance | 11 May 2015 | 8 Apr 1979 | $88,000 | 4 | 1 |
| 10 | Ines Varga | Engineering | 14 Nov 2022 | 28 Feb 1995 | $79,000 | 3 | 2 |
| 11 | Kenji Mori | Sales | 25 Aug 2025 | 16 Jul 2000 | $39,000 | 1 | 9 |
Lina Chen and Hugo Martin both earn $88,000, so G4 and G9 both show 1. Ines Varga's $79,000 is the next salary, and G10 shows 2. RANK.EQ would have given her 3.
Why it works
Works out the result of SUMPRODUCT (step 2) plus 1.
- 1. COUNTIF: Counts the cells in
E$2:E$11whose value is equal toE$2:E$11. - 2. SUMPRODUCT: Adds up every value of (
E$2:E$11is greater thanE2) divided by the result of step 1, working on whole ranges at once. - 3. Put together: Puts it together: the result of step 2 plus
1.
The standard rank, for comparison
RANK.EQ(E2, E$2:E$11) ranks from the highest, gives ties the same rank and then skips: two people at 1 means the next is 3. That's the usual “competition” ranking, and what most leaderboards use.
=RANK.EQ(E2,E$2:E$11)Dense rank from a sorted list (Excel 2021 and later)
With dynamic arrays, list each salary once from highest to lowest and find the position: XMATCH(E2, SORT(UNIQUE(E$2:E$11), , -1)). It reads more clearly, but needs Excel 2021 or later and isn't available in Google Sheets, which has no XMATCH.
=XMATCH(E2,SORT(UNIQUE(E$2:E$11),,-1))When you need it
Dense ranks suit league tables and grading bands where “second place” should mean the second-best result, not the third person in the list. They're also handy for turning values into a small number of levels, for example the salary tiers in a pay review. For prize-style leaderboards, where two people tying for first means nobody is second, the standard RANK.EQ is the right choice. Decide which one your reader expects before you publish the numbers, and label the column.
In Google Sheets
The SUMPRODUCT and COUNTIF formula works in Google Sheets unchanged. RANK.EQ exists in Sheets too. The XMATCH variant doesn't, because Google's function list has no XMATCH.
Common mistakes
Forgetting the
$on the range, so each row ranks against a shifted list.Using it on a range with blank cells: COUNTIF of a blank is 0, which makes the division fail. Use a range without blanks.
Expecting a dense rank from RANK.EQ: it always skips after ties.
Sources
Official documentation the facts on this page were checked against.