Skip to content
Advertisement

Tag: formula

Phpspreadsheet formula not accepted

With phpspreadsheet, i can’t put a formula in a cell. I get an error : L43 -> Formula Error: An unexpected error occurred While when i put this formula in an excel file directly it’s working nice. My formula is : “=IF(SUM(J2:J41)<>SUM(L2:L41);”1″;”2″)”. There is my code : $sheet->setCellValue($cell, $formula); I also test with $sheet->setCellValueExplicit($cell, $formula, DataType::TYPE_FORMULA); But i doesn’t work

PHP Recursively calculate a formula in an array in reverse

I would like te perform a calculation on the following array eventually the calculation would traverse into: I’ve tried recursively looping through the array using array_walk_recursive and custom functions which basically to the same. but the problem is that the add cannot calculate the ceil before it has calculated the multiply. So how can i recusively in reversed order calculate

Advertisement