Excel's RANK function assigns the same rank to tied values, which can leave gaps in your rankings or cause problems with lookup formulas that expect unique numbers. The fix is simple: combine RANK (or RANK.EQ) with a COUNTIF tiebreaker so each value gets a unique rank. This works in every modern version of Excel and takes one formula, no sorting required.

What You'll Need

  • A worksheet with a column of numeric values you want to rank (for example, scores in B2:B20)
  • Any version of Excel from Excel 2010 onward (steps also work in Excel for the web; menu labels can differ slightly between versions and platforms)

Step-by-Step

  1. Open your workbook and click the first empty cell where you want the rank to appear, next to your first value (for example, C2 if your scores start in B2).
  2. Enter the standard rank formula first: =RANK.EQ(B2,$B$2:$B$20). Use RANK instead of RANK.EQ if you prefer; both behave the same. The dollar signs lock the range so it doesn't shift when you copy the formula down.
  3. Now add the tiebreaker so duplicates no longer share a rank. Edit the formula to read: =RANK.EQ(B2,$B$2:$B$20)+COUNTIF($B$2:B2,B2)-1
  4. Look carefully at the second range: it starts locked at $B$2 but ends as a mixed reference B2. As you copy the formula down, that range expands, counting how many times the value has already appeared above the current row.
  5. Press Enter, then drag the fill handle (the small square at the bottom-right corner of the cell) down to the last row of your data, or double-click it to fill down automatically.
  6. Verify the result: tied values now get consecutive ranks instead of the same one. If two cells both contain 85 and 85 is the 3rd-highest score, one gets rank 3 and the other gets rank 4, with no gap and no duplicate.
  7. If you need the ranks in ascending order (lowest value = rank 1), add the third argument: =RANK.EQ(B2,$B$2:$B$20,1)+COUNTIF($B$2:B2,B2)-1
  8. Optionally, convert your data to an Excel Table (select the range, then Insert > Table) so the formula copies automatically when you add new rows.

Common Mistakes

  • Locking both ends of the COUNTIF range ($B$2:$B$20). If you do, every duplicate counts all its copies and the tiebreaker fails. The second endpoint must stay unlocked so it grows as you fill down.
  • Forgetting the dollar signs on the first endpoint. If COUNTIF starts at a relative B2, the counting window shifts and ranks become wrong further down the column.
  • Leaving the -1 off the end. Without it, every rank is one too high because COUNTIF counts the current cell itself.
  • Using this formula on text values. RANK.EQ only works with numbers; if your column contains text stored as numbers, convert it first (select the cells, check for a warning icon and choose Convert to Number).
  • Inserting rows inside the range after filling the formula. Extended mixed references can break; re-fill the formula from the top if your data layout changes.

Tips

  • To break ties in a specific order rather than top-down, sort your data first by the value and then by a secondary column (for example, name or date), then apply the formula. The row order determines which duplicate gets the higher rank.
  • Which duplicate gets which rank is determined purely by position: the one higher in the list gets the better (lower) rank.
  • If you have Excel 365 or Excel 2021, you can also generate unique ranks for a whole column at once with a dynamic array formula such as =RANK.EQ(B2:B20,B2:B20)+COUNTIF(OFFSET(B2,0,0,SEQUENCE(ROWS(B2:B20)),1),B2:B20)-1, but the copied single-cell formula above is simpler and works everywhere.
  • Give the rank column a clear header such as "Rank" and consider freezing the top row (View > Freeze Panes > Freeze Top Row) when working with long lists.
  • Test the formula on a small sample with deliberate duplicates before applying it to your full dataset.

Troubleshooting

Still seeing duplicate ranks? Check that you dragged the formula all the way down and that the COUNTIF range's second endpoint is relative (no dollar sign). Click a problem cell and look at the formula bar: the range should read something like $B$2:B15 near the bottom of the list.

Ranks are off by one everywhere? You likely dropped the -1 at the end of the formula or added it in the wrong place. It must come after the COUNTIF portion.

Getting a #N/A or #VALUE! error? RANK.EQ returns #N/A if the value isn't in the lookup range, usually because the locked range doesn't cover all your data. Extend $B$2:$B$20 to match your actual last row.

Wrong ranks after sorting the sheet? Sorting moves formulas with their rows and can shuffle the tiebreaker order. If you sort later, re-check the results or re-apply the formula from the top cell.

Numbers stored as text causing errors? Select the column, look for the green triangle warning, click it and choose Convert to Number, then re-fill the rank formula.

Frequently Asked Questions

What's the difference between RANK, RANK.EQ and RANK.AVG?

RANK is the original function, kept for compatibility. RANK.EQ is its modern equivalent and behaves identically. RANK.AVG gives tied values the average of their ranks instead of the same rank, so two values tied for 3rd both get 3.5, which still isn't unique.

Will this formula work in Google Sheets?

Yes. Google Sheets supports RANK.EQ and COUNTIF with the same syntax, so the exact same formula works there.

Does the tiebreaker change which value ranks higher overall?

No. The base rank still reflects the actual values. The tiebreaker only decides, among identical values, which one gets the slightly lower rank number.

Can I make the ranks update automatically when data changes?

Yes. Because these are live formulas, ranks recalculate whenever a value changes. Converting the data to an Excel Table ensures new rows get the formula too.

Why not just delete the duplicates instead?

Removing duplicates loses data. If two people genuinely scored the same, you usually want to keep both rows and simply give them unique positions, which is exactly what this method does.

Does the order of my data affect the result?

Only for the tied values. Among duplicates, the row closer to the top receives the better rank. All non-duplicate values rank the same regardless of row order.