I am trying to set the value of a cell in an Excel spreadsheet to a formula that references a worksheet and has several parameters to it. My formula is:
=SUMIFS('Sheet1'!AY:AY,'Sheet1'!J:J, "Q1", 'Sheet1'!M:M, "Extensions", 'Sheet1'!AW:AW, "NP")+SUMIFS('Sheet1'!AY:AY,'Sheet1'!J:J, "Q1", 'Sheet1'!M:M, "Extensions", 'Sheet1'!AW:AW, "PHBO")+SUMIFS('Sheet1'!AY:AY,'Shee1'!J:J, "Q1", 'Sheet1'!M:M, "Extensions", 'Sheet1'!AW:AW, "PR", 'Sheet1'!AN:AN, "Both")+SUMIFS('Sheet1'!AY:AY,'Sheet1'!J:J, "Q1", 'Sheet1'!M:M, "Extensions", 'Sheet1'!AW:AW, "PR", 'Sheet1'!AN:AN, "Area")
My PHP is:
$objPHPExcel->setActiveSheetIndex(1)
->setCellValue('B2', 'XXX');
Where XXX = the formula above. The problem is because of the ' and " marks in the formula I get errors.