Find smallest n numbers
This tutorial shows how to find the n smallest numbers from a specific range through the use of an Excel formula, with the IF, RANK and COUNT functions
=IF(RANK(C5,$C$5:$C$9)>=3,"Top 3 numbers","")
=IF(RANK(C8,$C$8:$C$12)>=$C$4,$C$5,"")
|
GENERIC FORMULA
=IF(RANK(number,range)>=smallest_n_numbers,value_if_true,value_if_false)
ARGUMENTS GENERIC FORMULA
=IF(RANK(number,range)<=smallest_n_numbers,value_if_true,value_if_false)
ARGUMENTS EXPLANATION This formula uses the IF and RANK functions to find the first n smallest numbers from a selected range and then returns a value that has been assigned as the true value, alternatively if the number is not one of the n smallest numbers from the range 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 number that represents the n smallest numbers and return values directly entered into the formula or referenced to specific cells that capture these values.
In this example the formula tests each of the numbers in range C5 to C9 (hard coded example) or C8 to C12 (cell reference example) to assess which of these numbers are the smallest 3 numbers and return "Top 3 numbers" (hard coded example) or value in cell C5 (cell reference example). For all the other numbers the formula will return a blank cell through the use of double quotation marks (""). |
Related Topic | Description | Related Topic and Description |
---|---|---|
Find largest n numbers | How to find the n largest numbers from a specific range | |
Lookup nth largest value | How to lookup the nth largest value in a range | |
Lookup nth largest value with criteria | How to lookup the nth largest value in a range with criteria |
Related Functions | Description | Related Functions and Description |
---|---|---|
IF Function | 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 |