Rank per Group in Excel

You have two groups of 20 students each. How do you determine the rank of all students within their respective groups? We can use the COUNTIFS function to calculate the rank per group in Excel.

Rank per Group Using a Regular Formula

=COUNTIFS(group_range, current_group, score_range, ">" & current_score) + 1

Rank per Group Using a Dynamic Array Formula

=COUNTIFS(group_range, group_range, score_range, ">" & score_range) + 1

Overall Ranking

The sample data consists of names in column A, groups in column B, and scores in column C. To find the overall rank, enter the following formula in cell D2:

=RANK(C2, $C$2:$C$21)

and drag the fill handle (the blue square at the bottom of the active cell) down.

If you are using an Excel version that supports dynamic arrays, you can enter the following formula in cell D2, which will automatically expand down:

=RANK(C2:C21, C2:C21)
Example of overall ranking in Excel

Examples of Group-wise Ranking in Excel

To determine the rank of students within their respective groups, known as group-wise ranking, you can use either the drag-down formula or a dynamic array formula.

Since the RANK function does not support conditional ranking in Excel, we use COUNTIFS as follows:

=COUNTIFS($B$2:$B$21, B2, $C$2:$C$21, ">"&C2) + 1

Enter this formula in cell E2 and drag the fill handle down.

Alternatively, if your version of Excel supports dynamic arrays, you can use this formula:

=COUNTIFS(B2:B21, B2:B21, C2:C21, ">"&C2:C21) + 1
Example of rank per group in Excel

How Does COUNTIFS Return Rank per Group in Excel?

The COUNTIFS function is a conditional count function that accepts multiple conditions.

The formula:

=COUNTIFS($B$2:$B$21, B2, $C$2:$C$21, ">"&C2)

counts how many values within the same group (column B) have a higher score (column C) than the current row’s score.

  • If the result is 0, adding +1 ensures the student receives the top rank.
  • If the result is 1, adding +1 ensures the student receives the second rank, and so on.

When dragged down, this formula applies group-wise ranking to all scores in the range.

The dynamic array formula works the same way but without the need to drag it down manually.

That’s all about rank per group in Excel!

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Filter Items Unique to Groups in Google Sheets

In this tutorial, we'll learn how to filter items unique to groups in Google...

Find Common Items Across Multiple Columns in Google Sheets

This tutorial explains how to find common items across multiple columns in Google Sheets....

Sort Column by Length of Text in Google Sheets

To sort a column by length of text, you can either use the QUERY...

Dynamic Way to Insert Blank Rows in a Table in Excel

Do you want to easily insert n number of blank rows in a table...

More like this

Dynamic Way to Insert Blank Rows in a Table in Excel

Do you want to easily insert n number of blank rows in a table...

Insert N Empty Cells Between Values in Excel (Dynamic Array)

Do you want to space out data by inserting a specific number of empty...

How to Extract the Last N Non-Blank Rows in Excel Dynamically

You can use the following formula to extract the last N non-blank rows in...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.