Skip to main content

MIN

Returns the smallest number in a set of values. Ignores logical values and text.

Syntax

expression.MIN(args);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
argsRequirednumber | number[] | ApiRange | ApiNameUp to 255 numeric values for which the smallest number will be returned. The first argument is required, subsequent arguments are optional. Arguments can be numbers, names, ranges, or arrays of numbers.

Returns

number

Example

Find the smallest number in a list of values in a spreadsheet.

// What is the minimum number in a set in a spreadsheet?

// Identify the lowest numeric value from a range in a spreadsheet.

const worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
let min = func.MIN(123, 197, 46, 345, 67, 456);
worksheet.GetRange("C1").SetValue(min);