MIN function

Synopsis
This function returns the minimum value found in an array. If the array is empty, the function returns an error.
Variations
MIN(SourceArray)
Returns the minimum of all elements of the source array.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array; Boolean array.
Returns
Returned types: Numeric.
Examples
1.

The following example finds the minimum value in the specified array. The function returns -100.

MIN([-99, 0, 5, 80, -100])
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([-99, 0, 5, 80, -100]) > 0, MIN([-99, 0, 5, 80, -100]) , -1)
MIN(SourceArray, StartIndex, Count)
Returns the minimum of all the elements of a subset of the source array.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array; Boolean array.
StartIndex

Specifies the beginning of the subset of the source array.

Supported types: Numeric.
Count

Specifies the number of elements to include in the subset of the source array.

Supported types: Numeric.
Returns
Returned types: Numeric.
Examples
1.

The following example finds the minimum value in [-99, 0, 5]. The function returns -99.

MIN([-99, 0, 5, 80, -100], 1, 3)
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([-99, 0, 5, 80, -100]) > 0, MIN([-99, 0, 5, 80, -100], 1, 3) , -1)
MIN(SourceArray, Expression)
Returns the minimum of all elements of the source array after performing an expression on each element.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array; Boolean array; String array; Point array; Object array.
Expression

Specifies the expression to apply to each element of the source array.

Supported types: Numeric.
Returns
Returned types: Numeric.
Examples
1.

The following example finds the minimum value of the specified array after reversing the sign of each element. The function returns -80.

MIN([-99, 0, 5, 80, -100], Item*-1)
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([-99, 0, 5, 80, -100]) > 0, MIN([-99, 0, 5, 80, -100], Item*-1) , -1)
MIN(SourceArray, StartIndex, Count, Expression)
Returns the minimum of all the elements of a subset of the source array after performing an expression on each element.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array; Boolean array; String array; Point array; Object array.
StartIndex

Specifies the beginning of the subset of the source array.

Supported types: Numeric.
Count

Specifies the number of elements to include in the subset of the source array.

Supported types: Numeric.
Expression

Specifies the expression to apply to each element of the source array.

Supported types: Numeric.
Returns
Returned types: Numeric.
Examples
1.

The following example finds the minimum value in [-99, 0, 5] after reversing the sign of each element. The function returns -5.

MIN([-99, 0, 5, 80, -100], 1, 3, Item*-1)
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([-99, 0, 5, 80, -100]) > 0, MIN([-99, 0, 5, 80, -100], 1, 3, Item*-1) , -1)