You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by bhavik <bh...@webdev.co.zw> on 2004/09/01 16:43:14 UTC

Parsing problems in formulas using cells in other sheets

Hi everyone,
 
Im having problems setting this formula using HSSF:
 
MIN('WEEK 1'!F9:'WEEK 1'!F9)
 
The FormulaParser is throwing me this:
 
java.lang.RuntimeException: Cannot Parse, sorry : ) 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.Match(FormulaParser.java:184)
        at
org.apache.poi.hssf.model.FormulaParser.function(FormulaParser.java:316)
        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:59
6)
        at
org.apache.poi.hssf.model.FormulaParser.parse(FormulaParser.java:700)
        at
org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:678)
 
 
 
The same exception is thrown when I tried to use SUM instead of MIN just
to see if it would work (with the same arguments). 
 
The formula works fine when I enter it directly into Excel.
 
The formula also works fine if I use an argument list instead of a range
of cells e.g.
            MIN('WEEK 1'!F9,'WEEK 1'!F9)
 
If I omit the 'WEEK 1' part of it, the parser does not complain - so im
sure the problem lies with the fact that im referencing cells in a
different sheet.
 
Is this a bug?
 
Thanks in advance for your time!
 
Regards,
 
Bhavik Merchant
Webdev (Pvt.) Limited
Physical Address: Cnr 9th St & Josiah Tongogara
Website: http://www.webdev.co.zw <http://www.webdev.co.zw/> 
Phone: +263 (0)4 702906
Cell: +263 (0)91666266