How to Rank Within a Category in Excel
Rank sales reps within their own region using COUNTIFS — a group-wise ranking that RANK alone cannot do.
You will learn to
- Rank a value against the whole list with COUNTIF
- Rank a value only against its own group with COUNTIFS
- Flip the comparison to rank lowest first
How it works
RANK.EQ ranks a value against the whole list, but often you need a rank inside a group — each rep within their region, each product within its category, each student within their class. The COUNTIFS trick does it: count how many rows are in the same group and have a bigger value, then add 1. =COUNTIFS($B$2:$B$11,B2,$C$2:$C$11,">"&C2)+1.
The top performer in each group gets rank 1, ties share a rank, and it works on unsorted data. Swap ">" for "<" to rank from lowest to highest instead.
=COUNTIFS($B$2:$B$11,B11,$C$2:$C$11,">"&C11)+1