Bug 42448

Summary: Can't parse SUMPRODUCT(A!C7:A!C67, B8:B68) / B69
Product: POI Reporter: bob.wilber
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description bob.wilber 2007-05-17 13:20:07 UTC
HSSFCell.setCellFormula() crashes with the following string:

"SUMPRODUCT(A!C7:A!C67, B8:B68) / B69"

(I had previously created a worksheet with the name "A", and was creating
this formula in a different worksheet.)

Excel is perfectly happy with htis formula when I type it in by hand.

The relevant part of the stack dump is:

at java.lang.String.charAt(String.java:687)
	at org.apache.poi.hssf.util.CellReference.<init>(CellReference.java:44)
	at org.apache.poi.hssf.util.AreaReference.<init>(AreaReference.java:33)
	at org.apache.poi.hssf.record.formula.Area3DPtg.setArea
(Area3DPtg.java:243)
	at org.apache.poi.hssf.record.formula.Area3DPtg.<init>
(Area3DPtg.java:58)
	at org.apache.poi.hssf.model.FormulaParser.Ident(FormulaParser.java:280)
	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.Arguments
(FormulaParser.java:443)
	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)
Comment 1 Yegor Kozlov 2008-05-17 06:05:50 UTC
Works with poi-3.1-beta2

Yegor