Rank Excel Records by Name, Subject, and Marks
Question details
Calculate a rank for each record within its name and subject group based on 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.
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.
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.
Select cell D2 and enter =COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2,$C$2:$C$1000,">="&C2).
Drag the fill handle from D2 down column D to apply the formula to the remaining records.
Compare the results in column D with records that have the same name in column A and subject in column B.

Assign Standard Competition Ranks Within Each Group
Use this method when tied marks should share the rank determined by the number of strictly higher marks.
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. Open your worksheet: Open WPS Spreadsheet and select File > Open to choose your workbook.
- 2. Check the columns: Place names in column A, subjects in column B, and numeric marks in column C, starting at row 2.
- 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. Fill the results: Drag the fill handle from D2 down column D, adjusting the formula's row 1000 limit if your data extends farther.

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.




