从另一个 sheet PHPExcel 获取公式

Getting formula from another sheet PHPExcel

我在使用 PHPexcel 执行公式时遇到问题。我从另一个 sheet 得到我的公式,它的名字是 Sample New Report。虽然我运行的时候没有报错但是程序执行后不知为何;它 returns 一个错误说 未定义的变量 A。你能帮我得到我的公式运行ning吗?

这是我的公式代码:

$rowCount2  = 4;
     $objPHPExcel->getActiveSheet()->setCellValue('B'.$rowCount2, 
      "=SUMIF('Sample New Report'!$A:$A,Incentive!$A4,'Sample New Report'!$Z:$Z)");

这与其他工作表无关:PHPExcel 不支持使用行 (2:2) 或列 (A:A) 引用的公式,无论是在同一个工作表中还是在另一个工作表中.改为使用范围

=SUMIF('Sample New Report'!$A1:$A1024,Incentive!$A4,'Sample New Report'!$Z1:$Z1024)