Rank by group

This tutorial shows how to rank a number by group through the use of an Excel formula, with the COUNTIFS function

EXCEL FORMULA 1. Rank by group

EXCEL

Rank by group

=COUNTIFS($B$5:$B$11,B5,$D$5:$D$11,">"&D5)+1
GENERIC FORMULA

=COUNTIFS(group_rng,group,rank_rng,">"&number)+1

ARGUMENTS
number: A number to rank.
rank_rng: A range that contains the numbers to rank.
group: A group that the number forms part of.
group_rng: A range that contains the groups assigned against each of the numbers to ranks.

EXPLANATION

This formula uses the COUNTIFS function to rank a list of values by group.

In this example each of the numbers have been assigned with either Group A or Group B and therefore are only ranked against the numbers that have been assigned with the same group.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to rank a list of values
How to test if a value in a cell is ranked first and return a value if the test is True or False
How to test if a value in a cell is ranked last and return a value if the test is True or False

RELATED FUNCTIONS

Related Functions Description Related Functions and Description
The Excel COUNTIFS function returns the number of cells in a range that meet one or more specified criteria