Bug 59736 - Incorrect evaluation of SUBTOTAL with composite interval
Summary: Incorrect evaluation of SUBTOTAL with composite interval
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.13-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 16:52 UTC by Luca Martini
Modified: 2016-07-31 20:01 UTC (History)
0 users



Attachments
sample workbook (8.55 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-06-20 16:52 UTC, Luca Martini
Details

Note You need to log in before you can comment on or make changes to this bug.
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,
    Luca
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/...