If ranked first

This tutorial shows how to test if a value in a cell is ranked first and return a value if the test is True or False through the use of Excel formulas, with the IF, RANK and MAX functions

EXCEL FORMULA 1. If ranked first using IF and RANK functions

EXCEL

Hard coded formula
If ranked first
Cell reference formula
If ranked first
=IF(RANK(C5,$C$5:$C$9)=1,"First Place","")
=IF(RANK(C7,$C$7:$C$11)=1,$C$4,"")
GENERIC FORMULA

=IF(RANK(number,range)=1,value_if_true, value_if_false)

ARGUMENTS
number: The number to rank.
range: A range that contains the numbers to rank.
value_if_true: Value to be returned if the number is ranked first from the selected range.
value_if_false: Value to be returned if the number is not ranked first from the selected range.

GENERIC FORMULA

=IF(RANK(number,range)=1,value_if_true, value_if_false)

ARGUMENTS
number: The number to rank.
range: A range that contains the numbers to rank.
value_if_true: Value to be returned if the number is ranked first from the selected range.
value_if_false: Value to be returned if the number is not ranked first from the selected range.

EXPLANATION

This formula uses the IF and RANK functions to assess if a number captured in a cell is ranked first from a list of other numbers. In other words, it tests if the selected number is the largest number in a range and then returns a value that has been assigned as the true value, alternatively if the number is not the largest number from the list the formula will return a value assigned as the false value.
Click on either the Hard Coded or Cell Reference button to view the formula that has the return values directly entered into the formula or referenced to specific cells that capture these values, respectively.

In this example the formula tests each of the numbers in range C5 to C9 (hard coded example) or C7 to C11 (cell reference example) to assess which of these numbers is the largest number and return "First Place" (hard coded example) or value in cell C4 (cell reference example). For the numbers that are not the largest the formula will return a blank cell through the use of double quotation marks ("").

EXCEL FORMULA 2. If ranked first using IF and MAX functions

EXCEL

Hard coded formula
If ranked first
Cell reference formula
If ranked first
=IF(C5=MAX($C$5:$C$9),"First Place","")
=IF(C7=MAX($C$7:$C$11),$C$4,"")
GENERIC FORMULA

=IF(number=MAX(range),value_if_true, value_if_false)

ARGUMENTS
number: The number to rank.
range: A range that contains the numbers to rank.
value_if_true: Value to be returned if the number is ranked first from the selected range.
value_if_false: Value to be returned if the number is not ranked first from the selected range.

GENERIC FORMULA

=IF(number=MAX(range),value_if_true, value_if_false)

ARGUMENTS
number: The number to rank.
range: A range that contains the numbers to rank.
value_if_true: Value to be returned if the number is ranked first from the selected range.
value_if_false: Value to be returned if the number is not ranked first from the selected range.

EXPLANATION

This formula uses the IF and MAX functions to assess if a number captured in a cell is ranked first from a list of other numbers. In other words, it tests if the selected number is the largest number in a range and then returns a value that has been assigned as the true value, alternatively if the number is not the largest number from the list the formula will return a value assigned as the false value.
Click on either the Hard Coded or Cell Reference button to view the formula that has the return values directly entered into the formula or referenced to specific cells that capture these values, respectively.

In this example the formula tests each of the numbers in range C5 to C9 (hard coded example) or C7 to C11 (cell reference example) to assess which of these numbers is the largest number and return "First Place" (hard coded example) or value in cell C4 (cell reference example). For the numbers that are not the largest the formula will return a blank cell through the use of double quotation marks ("").

RELATED TOPICS

Related Topic Description Related Topic and Description
How to lookup the nth largest value in a range through the use of an Excel formula or VBA
How to rank a list of values through the use of an Excel formula or VBA

RELATED FUNCTIONS

Related Functions Description Related Functions and Description
The Excel IF function performs a test on specified conditions entered into the formula and returns a specified value if the result is TRUE or another specified value if the result is FALSE
The Excel MAX function returns the largest value from a specified range of numeric values