跳到主要内容

ISNA

检查值是否为 #N/A,并返回 truefalse

语法

expression.ISNA(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | string | number | boolean | ApiName要测试的值。该值可以是空单元格、错误、逻辑值、文本、数字、区域或区域名称。

返回值

boolean

示例

识别电子表格中的单元格是否显示 N/A 错误。

// How do I check if a cell contains the N/A error in a spreadsheet?

// Use a function to find cells with N/A errors and handle them appropriately in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.ISNA("#N/A"));
worksheet.GetRange("A2").SetValue(func.ISNA(255));
worksheet.GetRange("A3").SetValue(func.ISNA("www.example.com"));