Im attempting to use the following formula within an excel spreadsheet using POI
3.1 - FINAL. Im not expecting 

My cell is as follows:

=SUM((OFFSET($A$1,ROW()-1,1)):(OFFSET($A$1,ROW()-1,COLUMN()-2)))


and I get the error 

Parse error near char 28 ':' in specified formula
'SUM((OFFSET($A$1,ROW()-1,1)):(OFFSET($A$1,ROW()-1,COLUMN()-2)))'. Expected ','
or ')'

I thought at first it was due to the combination of JXLS and POI I was using
(Its worth noting Im using a combination of JXLS and POI (using a forked version
of JXLS that I have made compatable with POI 3.1-FINAL)) but I have performed a
few more basic tests by adding to the JUnit test
org.apache.poi.hssf.model.TestFormulaParser:

e.g.

Ptg[] ptgs = parseFormula("SUM((C1):(C2))");
assertEquals(2, ptgs.length);


Ptg[] ptgs =
parseFormula("SUM((OFFSET($A$1,ROW()-1,1)):(OFFSET($A$1,ROW()-1,COLUMN()-2)))");
assertEquals(2, ptgs.length);

In both situations the nested brackets cause the parser to fail at the colon. Is
there a workaround that will allow me to sum  in this fashion?

I am using offset because the range of cells is not known at the time I create
my template. I have also tried creating a named range for the data, but JXLS
cant support it from best I can tell.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to