You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Andrew Kharchuk <ak...@ukraina.com> on 2004/11/04 12:37:52 UTC

Problem with formula

When I'm trying to set the following formula value
"IF(ISBLANK(C2);0;IF(ISBLANK(L5);0;L5*C2)" I get an Exception. What is
wrong?

java.lang.RuntimeException: Cannot Parse, sorry : Integer Expected
 at org.apache.poi.hssf.model.FormulaParser.Abort(FormulaParser.java:117)
 at org.apache.poi.hssf.model.FormulaParser.Expected(FormulaParser.java:124)
 at org.apache.poi.hssf.model.FormulaParser.GetNum(FormulaParser.java:239)
 at org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:479)
 at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
 at
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596)
 at
org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:453)
 at org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:315)
 at org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:265)
 at org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:474)
 at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
 at
org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596)
 at org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:700)
 at org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:678)


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Problem with formula

Posted by Danny Mui <da...@muibros.com>.
ooh good catch..nevermind about the bugzilla submission then!! :D

Chris Cheshire wrote:
> Andrew, it looks like you are missing a closing parenthesis in that 
> equation. Try "IF(ISBLANK(C2);0;IF(ISBLANK(L5);0;L5*C2))".
> 
> Chris
> 
> Danny Mui wrote:
> 
>> It would be most helpful if you can enter this into bugzilla, with a 
>> junit testcase.
>>
>> thanks
>>
>> Andrew Kharchuk wrote:
>>
>>> When I'm trying to set the following formula value
>>> "IF(ISBLANK(C2);0;IF(ISBLANK(L5);0;L5*C2)" I get an Exception. What is
>>> wrong?
>>>
>>> java.lang.RuntimeException: Cannot Parse, sorry : Integer Expected
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.Abort(FormulaParser.java:117)
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.Expected(FormulaParser.java:124)
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.GetNum(FormulaParser.java:239)
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:479)
>>>  at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
>>>  at
>>> org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596) 
>>>
>>>  at
>>> org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:453) 
>>>
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:315)
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:265)
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:474)
>>>  at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
>>>  at
>>> org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596) 
>>>
>>>  at 
>>> org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:700)
>>>  at 
>>> org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:678)
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Problem with formula

Posted by Chris Cheshire <cc...@bigredwire.com>.
Andrew, it looks like you are missing a closing parenthesis in that 
equation. Try "IF(ISBLANK(C2);0;IF(ISBLANK(L5);0;L5*C2))".

Chris

Danny Mui wrote:
> It would be most helpful if you can enter this into bugzilla, with a 
> junit testcase.
> 
> thanks
> 
> Andrew Kharchuk wrote:
> 
>> When I'm trying to set the following formula value
>> "IF(ISBLANK(C2);0;IF(ISBLANK(L5);0;L5*C2)" I get an Exception. What is
>> wrong?
>>
>> java.lang.RuntimeException: Cannot Parse, sorry : Integer Expected
>>  at org.apache.poi.hssf.model.FormulaParser.Abort(FormulaParser.java:117)
>>  at 
>> org.apache.poi.hssf.model.FormulaParser.Expected(FormulaParser.java:124)
>>  at 
>> org.apache.poi.hssf.model.FormulaParser.GetNum(FormulaParser.java:239)
>>  at 
>> org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:479)
>>  at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
>>  at
>> org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596) 
>>
>>  at
>> org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:453)
>>  at 
>> org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:315)
>>  at org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:265)
>>  at 
>> org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:474)
>>  at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
>>  at
>> org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596) 
>>
>>  at org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:700)
>>  at 
>> org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:678)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Problem with formula

Posted by Danny Mui <da...@muibros.com>.
It would be most helpful if you can enter this into bugzilla, with a 
junit testcase.

thanks

Andrew Kharchuk wrote:
> When I'm trying to set the following formula value
> "IF(ISBLANK(C2);0;IF(ISBLANK(L5);0;L5*C2)" I get an Exception. What is
> wrong?
> 
> java.lang.RuntimeException: Cannot Parse, sorry : Integer Expected
>  at org.apache.poi.hssf.model.FormulaParser.Abort(FormulaParser.java:117)
>  at org.apache.poi.hssf.model.FormulaParser.Expected(FormulaParser.java:124)
>  at org.apache.poi.hssf.model.FormulaParser.GetNum(FormulaParser.java:239)
>  at org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:479)
>  at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
>  at
> org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596)
>  at
> org.apache.poi.hssf.model.FormulaParser.Arguments(FormulaParser.java:453)
>  at org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:315)
>  at org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:265)
>  at org.apache.poi.hssf.model.FormulaParser.Factor(FormulaParser.java:474)
>  at org.apache.poi.hssf.model.FormulaParser.Term(FormulaParser.java:548)
>  at
> org.apache.poi.hssf.model.FormulaParser.Expression(FormulaParser.java:596)
>  at org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:700)
>  at org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:678)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org