跳到主要内容

MIN

返回一组值中的最小数字。忽略逻辑值和文本。

语法

expression.MIN(args);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
args必需number | number[] | ApiRange | ApiName最多 255 个数值,将返回其中的最小数。第一个参数是必需的,后续参数是可选的。参数可以是数字、名称、区域或数字数组。

返回值

number

示例

查找电子表格中值列表中的最小数。

// 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);