使用Node.js通过C++计算Excel 2016中的MINIFS和MAXIFS函数
Contents
[
Hide
]
可能的使用场景
Microsoft Excel 2016支持MINIFS和MAXIFS函数。这些函数在Excel 2013或更早版本中不支持。Aspose.Cells for Node.js via C++也支持这些函数的计算。以下截图显示了这些函数的用法。请阅读截图中的红色注释以了解这些函数的工作原理。
计算Excel 2016的MINIFS和MAXIFS函数
以下示例代码加载示例Excel文件,调用Workbook.calculateFormula()方法,通过Aspose.Cells for Node.js via C++进行公式计算,然后将结果保存为输出PDF。
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const sourceFilePath = path.join(dataDir, "sampleMINIFSAndMAXIFS.xlsx");
// Load your source workbook containing MINIFS and MAXIFS functions
const workbook = new AsposeCells.Workbook(sourceFilePath);
// Perform Aspose.Cells formula calculation
workbook.calculateFormula();
// Save the calculations result in pdf format
const options = new AsposeCells.PdfSaveOptions();
options.setOnePagePerSheet(true);
const outputFilePath = path.join(dataDir, "outputMINIFSAndMAXIFS.pdf");
workbook.save(outputFilePath, options);