ISNA
检查值是否为 #N/A,并返回 true 或 false。
语法
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"));