PhpExcel 公式

PhpExcel Formulas

我在 Codeigniter 3.0.0 中使用 PhpExcel 1.8.0,Codeigniter 在 WAPP Stack Server 5.4.39-0 中 运行(我认为它们都应该是最新版本)。

这个:

$this->excel->getActiveSheet()->setCellValue('G5', "SUMA(G1:G4)");

用坐标显示下载文件中的字符串"SUMA",但添加“=”会导致服务器响应错误,Chrome将其解释为"ERR_INVALID_RESPONSE".

指定的范围填充了整数值。

我不太习惯 Wapp,Apache 日志文件没有显示与此问题相关的错误,我非常希望知道我可以调试它的方法。

提前致谢。

SUMA 不是任何 Excel 函数的 "English Language" 名称。

引用 PHPExcel 文档(标题为 Write a formula into a cell)

Inside the Excel file, formulas are always stored as they would appear in an English version of Microsoft Office Excel, and PHPExcel handles all formulae internally in this format. This means that the following rules hold:

  • 小数点分隔符是“.” (句点)
  • 函数参数分隔符是“,”(逗号)
  • 矩阵行分隔符是';' (分号)
  • 必须使用英文函数名

(我的重点)

如果您想在公式中使用 non-English 函数名称,请阅读 Locale Settings for Formulae

文档的相应部分