Min Function

Top  Previous  Next

Returns the lowest value in a list of values. This function takes an unlimited number of arguments but requires at least one argument. See also Lowest.

 

Syntax

 

value = Min( expression1, expression2, expression3, ... )

 

Parameters

expression1

 

any numeric expression

expression2

 

any numeric expression

expression3

 

any numeric expression

 

 

 

returns

 

the lowest value of the list of expressions

 

Examples

 

value = Min( 5, 6, 8 )                 ' Returns 5

value = Min( 2 + 1, 5 )                ' Returns 3

 

 

Min or Max can be used in place of an IF loop in certain cases.  Instead of:

 

IF ( var1 <= var2 ) THEN

   var3 = var1

ELSE

   var3 = var2

ENDIF

 

You could just use this:

 

var3 = Min(var1, var2)