Function Problems

Rank Excel Records by Name, Subject, and Marks

Muhammad TalhaMuhammad Talha Nov 18, 2026 870 views

Question details

Calculate a rank for each record within its name and subject group based on marks.

Rank Excel Records by Name, Subject, and Marks
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains names, subjects, and marks, and each record needs a rank relative to others with the same name and subject.
Observed behavior
Records with the same name and subject are compared by marks, and tied marks receive the same rank.
Before you start

Arrange names in column A, subjects in column B, and numeric marks in column C, with data starting in row 2. Adjust the range ending at row 1000 in each formula to include all your records.

Solution 1Recommended

Count Equal or Higher Marks Within Each Group

Use this method to rank each record by counting marks greater than or equal to its mark within the same name and subject group.

1
Enter the formula

Select cell D2 and enter =COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2,$C$2:$C$1000,">="&C2).

2
Fill down

Drag the fill handle from D2 down column D to apply the formula to the remaining records.

3
Check the groups

Compare the results in column D with records that have the same name in column A and subject in column B.

Count Equal or Higher Marks Within Each Group
How ties are counted: This formula includes every tied record in the count. For marks 100, 100, and 90 in one group, it returns 2, 2, and 3. Use the next solution if the highest tied marks should receive rank 1.
Rank marks in WPS Spreadsheet

Rank Marks by Name and Subject in WPS Spreadsheet

Use COUNTIFS in WPS Spreadsheet to compare marks within each name and subject group, then fill the formula down your worksheet.

  1. 1. Open your worksheet: Open WPS Spreadsheet and select File > Open to choose your workbook.
  2. 2. Check the columns: Place names in column A, subjects in column B, and numeric marks in column C, starting at row 2.
  3. 3. Enter the formula: Select D2 and enter =COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2,$C$2:$C$1000,">="&C2).
  4. 4. Fill the results: Drag the fill handle from D2 down column D, adjusting the formula's row 1000 limit if your data extends farther.
Calculate group ranks with a single COUNTIFS formula.Open and edit Microsoft Excel XLSX and XLS files.Fill formulas down quickly with a familiar spreadsheet interface.Use WPS Office for free.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the highest tied mark receive a rank greater than 1?

The greater-than-or-equal-to formula counts every record tied at that mark, including the current record. Use =1+COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2,$C$2:$C$1000,">"&C2) in D2 if the highest ties should receive rank 1.

Does the formula compare marks across different subjects?

No. The COUNTIFS condition $B$2:$B$1000,B2 limits the comparison to records with the same subject, while the column A condition matches the name.

How do I include records below row 1000?

In the formula entered in D2, change every occurrence of row 1000 to the last row you need, such as row 5000, and fill the revised formula down.

Can I use the same formulas in WPS Spreadsheet?

Yes. Open the workbook in WPS Spreadsheet, enter either COUNTIFS formula in D2, and drag the fill handle down to calculate the other rows.