#Value error when emtpy cell explicitly set to 'number' is referenced

Topics: Developer Forum
May 2, 2011 at 7:59 PM

I get a #Value error when I want to calculate a formula that references an empty cell that is explicitly set to 'number' (in cell properties) .
If the cell properties are set to 'General' the PHPExcel returns the right value.

Simple example (B4 = 2 and C4 is an empty cell with its properties set to 'number')
By the way: If the cell properties are set to 'General' the PHPExcel returns the expected value.

D4 Value is =B4+C4
D4 Expected Value is 2
Parser Stack :-

Array
(
[0] => Array
(
[type] => Cell Reference
[value] => B4
[reference] => B4
)

[1] => Array
(
[type] => Cell Reference
[value] => C4
[reference] => C4
)

[2] => Array
(
[type] => Binary Operator
[value] => +
[reference] =>
)

)

D4 Calculated Value is #VALUE!

Evaluation Log:

Array
(
[0] => Blad1!D4 -> Evaluating Cell B4 in current worksheet
[1] => Blad1!D4 -> Evaluation Result for cell Blad1!B4 is a floating point number with a value of 2
[2] => Blad1!D4 -> Evaluating Cell C4 in current worksheet
[3] => Blad1!D4 -> Evaluation Result for cell Blad1!C4 is an empty string
[4] => Blad1!D4 -> Evaluating 2 +
[5] => Blad1!D4 -> Evaluation Result is a #VALUE! error
)