0
votes

I'm having trouble in executing my formula using PHPexcel. I'm getting my formula from another sheet which name is Sample New Report. Although there are no errors when I run it but for some reason after the program is executed; it returns an error saying Undefined variable A. Can you help me in getting my formula running?

Here's my formula code:

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

1 Answers

0
votes

This isn't anything to do with other sheets: PHPExcel does not support formulae using row (2:2) or column (A:A) references, whether in the same worksheet or in another worksheet. Use ranges instead

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