Author: Oscar Cronquist Article last updated on May 03, 2023 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 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.

## 2. Get the smallest number larger than a given number in a date range Formula in cell F10:

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

### 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. 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. 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. 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.

#### 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.

## Get Excel *.xlsx file

### Get the Excel file Get-the-smallest-number-larger-than-a-given-number.xlsx