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 Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. With years of experience working with Google Sheets and Excel for multinational firms in Mumbai and Dubai, he has been blogging since 2012, offering practical, real-world spreadsheet solutions that professionals rely on. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

More like this

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

Sort Each Row Individually in Excel Using a LAMBDA Formula

Sorting rows in Excel typically refers to rearranging entire datasets based on values in...

Sort by Field Labels Using the SORT and XMATCH Combo in Excel

Want to sort your Excel data by column names instead of column positions? Learn...

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.