How to rank duplicates and assign different ranks in Excel

Deepanshu Bhalla Add Comment

This article explains the process of ranking and assigning different ranks to duplicates in Excel.

Example

Let's say you have a dataset containing students' names along with their english scores. There are instances where some students have achieved the same score. You need to rank these students based on their scores. Make sure you assign different ranks to the students with the same score.



For descending (decreasing) order :

In cell D3, type the following formula.

=RANK(C3,$C$3:$C$10,0)+COUNTIF(C3:$C$10,C3)-1

For ascending (increasing) order :

In cell E3, type the following formula.

=RANK(C3,$C$3:$C$10,1)+COUNTIF(C3:$C$10,C3)-1

The formula above calculates the initial rank using RANK and then adjusts the rank based on the number of duplicates for the value in C3. The result is the final rank for the value in C3 within the range $C$3:$C$10.

  1. The RANK(C3,$C$3:$C$10,0) part calculates the rank of the value in cell C3 within the range $C$3:$C$10. It assigns a rank based on the descending order of values in the range.
  2. The COUNTIF(C3:$C$10,C3) part counts the number of occurrences of the value in cell C3 within the range $C$3:$C$10. It determines the number of duplicates for the value in C3.
  3. The +COUNTIF(C3:$C$10,C3)-1 part adjusts the rank by subtracting 1 for each duplicate occurrence. This ensures that each duplicate value receives a unique rank.
Download the workbook

Related Article : Rank duplicates without breaking sequence
Related Posts
Spread the Word!
Share
About Author:
Deepanshu Bhalla

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and HR.

Post Comment 0 Response to "How to rank duplicates and assign different ranks in Excel"
Next → ← Prev