On Tue, 9 Aug 2011, Chris McCann wrote:
<c r="R40" s="52">
 <f t="shared" si="58"/>
 <v>0</v>
</c>
<c r="S40" s="52">
 <f t="shared" ref="M40:V42"
si="59">SUMIF($AI$3:$JN$3,S$36,$AI40:$JN40)</f>
 <v>0</v>
</c>

My assumptions are that <f> is "formula", t = "type", si = "shared index"
and <v> = value.

Off the top of my head, I think that's correct. If you look in the file format documentation (linked from the poi website, but it's a bit big...) it'll confirm


Evaluating the cells using POI (in a JRuby app) shows the following two cell
formulas:

R40 = SUMIF($AI$3:$JN$3,R$36,$AI40:$JN40)
S40 = SUMIF($AI$3:$JN$3,*Y$36*,$AI40:$JN40)

Clearly something is amiss with the Y$36 reference in S40 -- it should be
S$36.  The SUMIF for T46 likewise shows what looks to be the correct formula
in the XML file but POI shows the 2nd param to the formula to be AA$36
instead of T$36.

Firstly, any chance you could open a new bug in bugzilla, and upload the problem file? (Or if not that one, a similar one with dummy data that shows the same thing). If you can, then also do a short unit test using the file which shows POI getting the formula correct on the first cell, but incorrect on a later shared one

If you look in XSSFCell, then I think it's the convertSharedFormula method that's used to look up the formula in the later cells. If you have time, I'd suggest you then dive into that with a debugger against your unit test, and see if you can spot the incorrect logic

Cheers
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to