Author: Oscar Cronquist Article last updated on May 03, 2023

Get the smallest number larger than a given number and a condition

This article demonstrates how to extract the largest number smaller than a given number based on a condition and criteria.

1. Get the smallest number larger than a given number and a condition

Get the smallest number larger than a given number and a condition

Formula in E6:

=MINIFS(B3:B8,B3:B8,">"&F2, B5:B10, G4)

The MINIFS function calculates the smallest value based on a given set of criteria.

Formula in cell F6:

=MINIFS(C3:C8,C3:C8,">"&F2, B5:B10, G4)

MINIFS(min_rangecriteria_range1criteria1, [criteria_range2criteria2], ...)

min_range - Required. A reference to the numbers.
criteria_range1 -  A reference to cells to evaluate based on the criteria.
criteria1 - Criteria in the form of a number, expression, or text.

MINIFS function was introduced in Excel 2016, you can use the following formulas if you don't have access to the function.

Back to top

2. Get the smallest number larger than a given number in a date range

Get the smallest number larger than a given number and a date range

Formula in cell F10:

=MINIFS(C5:C10,C5:C10,">"&G6,B5:B10,">="&G4,B5:B10,"<="&G5)

Back to top

2.1 Explaining formula in cell F10

MINIFS(min_rangecriteria_range1criteria1, [criteria_range2criteria2], ...)

Step 1 - First condition

The first criteria_range1 is C5:C10, the first criteria1 is ">"&G6.

The ampersand character concatenates the larger than character and the condition specified in cell G6.

C5:C10,">"&G6

The first criteria pair checks if the values in C5:C10 are larger than the value in cell G6.

Get the smallest number larger than a given number and a date range first condition 1

The image above highlights which cells contain a number larger than the condition.

Step 2 - Second condition

The second criteria_range2 is B5:B10, the second criteria2 is ">="&G4.

The ampersand character concatenates the larger than character, the equal sign, and the condition specified in cell G4.

B5:B10,">="&G4

The second criteria pair checks if the dates in B5:B10 are later or equal to the date in cell G4.

Get the smallest number larger than a given number and a date range second condition

The image above shows that all dates are equal or later than the start range date specified in cell G4.

Step 3 - Third condition

The third criteria_range2 is again B5:B10, the third criteria2 is "<="&G5.

The ampersand character concatenates the less than character, the equal sign, and the condition specified in cell G4.

B5:B10,"<="&G5

The second criteria pair checks if the dates in B5:B10 are later or equal to the date in cell G4.

Get the smallest number larger than a given number and a date range third condition

The image above highlights dates equal to or earlier than the start range date specified in cell G4.

Step 4 - Evaluate MINIFS function

The MINIFS function calculates the smallest value based on a given set of criteria.

MINIFS(min_rangecriteria_range1criteria1, [criteria_range2criteria2], ...)

MINIFS(C5:C10,C5:C10,">"&G6,B5:B10,">="&G4,B5:B10,"<="&G5)

returns 3.04 in cell F10. When all conditions are met value 3.04 is returned.

Back to top

Formula in cell G10

MINIFS(D5:D10,D5:D10,">"&G6,B5:B10,">="&G4,B5:B10,"<="&G5)

returns 4.2. Values 4.2 and 5.33 meet all conditions, however, 4.2 is the smallest.

Back to top

Get Excel *.xlsx file

Back to top

Useful links

Find the smallest number that is larger than a given number - [Excel 2016]
Find the smallest number that is larger than a given number - earlier Excel versions
Find the largest number that is smaller than a given number - [Excel 2016]
Find the largest number that is smaller than a given number - earlier Excel versions
How to find the k-th smallest number that is larger than a given number?
How to find the k-th largest number that is smaller than a given number?

MINIFS function - Microsoft

Combine Text from Multiple Cells - Contextures

Using calculation operators in Excel formulas