下面的代码生成带有“ =#N / A”的单元格。知道为什么吗?手动创建的excel文件中使用相同的公式。公式是否太高级或对PHPExcel有用?谢谢!
$objWorksheet->setCellValue("A$excelRow", '=IFERROR(IF((INDIRECT("A"&ROW()-1))="Seq. #",1,IF(ISTEXT([@Column2]),COUNTA(INDIRECT("B20"):[@Column2]),"")),"")'); // Seq. #
$objWorksheet->setCellValue("J$excelRow", '=IFERROR(IF(OR([@Column6]="",[@Column9]=""),"",(INT(((([@Column7]-[@Column4])*3600)+(([@Column8]-[@Column5])*60)+([@Column9]-[@Column6]))/60))),"")'); // Duration min
$objWorksheet->setCellValue("K$excelRow", '=IFERROR(IF(OR([@Column6]="",[@Column9]=""),"",(MOD(MOD(((([@Column7]-[@Column4])*3600)+(([@Column8]-[@Column5])*60)+([@Column9]-[@Column6])),3600),60))),"")'); // Duration sec