Problem in reading formula : IF( IF )

Topics: Developer Forum, User Forum
Jul 6, 2009 at 9:34 PM
Edited Jul 7, 2009 at 5:05 PM


I had a problem today to read this formula :

(a)  IF(A1=0;IF(A2=0;1;4);2) < Doesn't work

I am reading an XLS file (save as 97-03) with formula (a) in a cell. I have to modify this XLS file and save it again.

$reader = PHPExcel_IOFactory::createReader('Excel5');
$excel = $reader->load('before.xls');
var_dump ($excel->getActiveSheet()); // The formula doesn't still here
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
$writer->save('after.xls'); // The formula isn't present in the file.

If I replace X with this line, the formula is well writing in the file but I can't use this line because I want it dynamicly ...
$excel->getActiveSheet()->setCellValue('B1', 'IF(A1=0,IF(A2=0,1,4),2)');


I hope that someone can help me ;)
Have a nice day.

IF(A1=0;1;2) < Reading works
IF(A1=0;SUM(B1;B2);2) < Reading works


EDIT : tested with v1.6.7 and the last change set (28100)

Jul 8, 2009 at 4:22 AM

Bug verified. Should be fixed per work item 10272:

Download latest source at next check-out: