Bug 64384 - SUBTOTAL function fails with scalar as 2nd parameter
Summary: SUBTOTAL function fails with scalar as 2nd parameter
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:4.1.0 target:4.0.4 target:3.6.7
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-09 08:55 UTC by GerardF
Modified: 2013-05-13 13:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
SUBTOTAL test spreedsheet (9.17 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-05-09 08:55 UTC, GerardF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description GerardF 2013-05-09 08:55:03 UTC
Created attachment 79043 [details]
SUBTOTAL test spreedsheet

I don't know if I may set this as bug or enhancement...

=SUBTOTAL(3;A2) will returns always 1 even if A2 (non-emty) hidden by filtering.

Workaround : Works with a pseudo-range
=SUBTOTAL(3;A2:A2)

Someone (Eike ?) fix the same kind of bug with MATCH.
But it is perhaps more difficult...
Comment 1 Julien Nabet 2013-05-09 15:30:48 UTC
GerardF: I'm not Calc expert but indeed A2, on the contrary of A2:A2, is not a range. So it seems normal that subtotal works as you expect on column C but not on column B.
(tested with master sources updated today).

Eike: should "A2" be considered as a range or converted to "A2:A2" as it?
Comment 2 GerardF 2013-05-09 15:59:30 UTC
(In reply to comment #1)
> GerardF: I'm not Calc expert but indeed A2, on the contrary of A2:A2, is not
> a range. So it seems normal that subtotal works as you expect on column C
> but not on column B.

Right. SUBTOTAL expect a range here but MATCH also and MATCH was changed to accept a scalar...

That's also why I suggest to tag this as an Enhancement.
Comment 3 Eike Rathke 2013-05-10 16:00:19 UTC
Taking. Simply a bug, not an enhancement.
Comment 4 Commit Notification 2013-05-10 16:18:22 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3c2d0acc871057573fe9ab45b8161fce70190e80

resolved fdo#64384 check subtotal row filtered also for single reference



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2013-05-11 21:43:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f21815f9fe2609dd4ea152c65bb98b77b0a141f7&h=libreoffice-4-0

resolved fdo#64384 check subtotal row filtered also for single reference


It will be available in LibreOffice 4.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2013-05-13 10:43:00 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2c84287f151f14a4a6204fef30546414cf3d27f8&h=libreoffice-3-6

resolved fdo#64384 check subtotal row filtered also for single reference


It will be available in LibreOffice 3.6.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.