PHPExcel公式错误


PHPExcel formula error

>我正在尝试读取工作簿,但出现以下错误:

致命错误:未捕获的异常"PHPExcel_Calculation_Exception",消息为"工作表(abc(!F6 -> ID!F3 -> 公式错误:C:''webserver''Apache''htdocs''ExcelSheetReader''PHPExcel_1.7.9_new buss req''Classes''PHPExcel''Cell.php:298 堆栈跟踪:#0 C:''webserver''Apache''htdocs''ExcelSheetReader''PHPExcel_1.7.9_new buss req''Classes''PHPExcel''Worksheet.php(2432(: PHPExcel_Cell->getCalculatedValue(( #1 C:''webserver''Apache''htdocs''ExcelSheetReader''PHPExcel_1.7.9_new buss req''Classes''PHPExcel''Worksheet.php(2508(: PHPExcel_Worksheet->rangeToArray('A1:N260', NULL, true, true, true( #2 C:''webserver''Apache''htdocs''ExcelSheetReader''PHPExcel_1.7.9_new buss req''Workbook''read_credits_v3_revised.php(36(: PHPExcel_Worksheet->toArray(NULL, true, true, true( #3 {main} 在 C:''webserver''Apache''htdocs''ExcelSheetReader''PHPExcel_1.7.9_new buss req''Classes''PHPExcel''Cell.php 在第 298 行

工作表 (abc( 单元格 F6 中的公式是 =ID!F3,而在工作表ID单元格F3中,公式为= SUM(IDc1.2Y,IDc1.3Y,IDc1.4Y,IDc1.5Y,IDc1.6Y,IDc2.3Y,IDc3.1Y,IDc3.2Y,IDc3.3Y,IDc3.4Y(请指导我在工作表中找到问题,因为我认为公式没有任何问题。

我也得到这个:未捕获的异常"PHPExcel_Calculation_Exception",消息为"LL!F3 ->公式错误:意外的"(">"工作表 LL 单元格 F3 中的公式是 =MAX(LLc1Y, MIN(10,SUM(LLc2Y,MAX(LLc3.1Y,LLc3.2Y(,LLc3.3Y,LLc4Y,LLc5.1Y,LLc5.2Y,LLc5.3Y,LLc6Y((( 这对我来说似乎也不错,但仍然得到错误。

如果可能的话,请帮助我解决此错误。还有什么方法可以通过忽略任何公式问题从工作表中读取数据?

使用以下参数调用 toArray() 方法。

PHPExcel_Worksheet->toArray(NULL, true, true, true) 

查看文档,了解可以传递给正在使用的toArray()方法的实际参数:

* @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
* @param boolean $calculateFormulas Should formulas be calculated?
* @param boolean $formatData  Should formatting be applied to cell values?
* @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
*                               True - Return rows and columns indexed by their actual row and column IDs

特别是,看看第二个参数(你正在传递一个true(。如果您不想计算公式,请传递false,但请记住,您为这些单元格返回的结果将是实际公式本身,而不是计算值