Bug 59736

Summary: Incorrect evaluation of SUBTOTAL with composite interval
Product: POI Reporter: Luca Martini <lucamartini>
Component: SS CommonAssignee: POI Developers List <dev>
Severity: major    
Priority: P2    
Version: 3.13-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: sample workbook

Description Luca Martini 2016-06-20 16:52:51 UTC
Created attachment 33968 [details]
sample workbook

The SUBTOTAL function is not ignoring nested subtotals when the second argument is specified as disjoint interval with the semicolon.

Sample case:
Cell | Contents
A1   | 1
A2   | =SUBTOTAL(9;A1)
A3   | =SUBTOTAL(9;A1;A2)

A3 should evaluate to 1, instead the result is 2. If the formula in cell A3 is written as =SUBTOTAL(9;A1:A2) the evaluation is correct (1).
I attach a simple workbook that reproduces the case.

Best regards,
Comment 1 Dominik Stadler 2016-07-31 20:01:07 UTC
This was fixed via r1754674, previously it did not work for LazyRefEval, which "lost" the "isSubtotal()" information prior to being passed to the Subtotal class. We now look up this information as well to exclude those subtotals from the sum/avg/...