FormulaCraft

How to rank values without ties in Excel and Google Sheets

Topic:RANK & statistical aggregates
Excel & Google Sheets
=RANK(B2,B$2:B$6,0)+COUNTIF(B$2:B2,B2)-1

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1In the first output cell next to your data (e.g. C2), type =RANK(B2,B$2:B$6,0)+COUNTIF(B$2:B2,B2)-1.
  2. 2The RANK part assigns the base rank; the COUNTIF tiebreaker adds an offset based on how many times the value has appeared so far.
  3. 3Use absolute references for the full range (B$2:B$6) but a mixed reference expanding from the top (B$2:B2) for the COUNTIF.
  4. 4Copy the formula down for all rows.
  5. 5Change the third argument of RANK from 0 (descending) to 1 (ascending) to reverse the ranking direction.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Does this formula guarantee unique ranks?

Yes. Each tied value gets a different offset from COUNTIF, so no two rows share the same final rank — they are differentiated by list position.

What does the 0 in RANK mean?

0 means descending order (largest value = rank 1). Use 1 for ascending order (smallest value = rank 1).

More on RANK & statistical aggregates

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: