Spread.Sheets 支持数组函数。
使用 Ctrl + Shift + Enter 或者 setArrayFormula 方法来创建一个数组函数。
数组函数支持导出 Excel 文件或者 JSON 格式的数据。
但是 Spread.Sheets 中的数组函数有如下限制:
示例代码
以下代码使用了 setArrayFormula 方法。
activeSheet.getCell(1,1).value(3); activeSheet.getCell(2,1).value(1); activeSheet.getCell(3,1).value(3); activeSheet.getCell(4,1).value(7); activeSheet.getCell(1,2).value(7); activeSheet.getCell(2,2).value(7); activeSheet.getCell(3,2).value(7); activeSheet.getCell(4,2).value(7); spread.options.allowUserEditFormula = true; activeSheet.setArrayFormula(0, 3, 4, 1, "B2:B5*C2:C5"); |