[Upstream] Calc DCOUNT function does not throw error in malformed expression =DCOUNT(A4:E13,0,A16:E17)

Bug #681080 reported by Christoph Arenz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LibreOffice
Invalid
Wishlist
gnumeric (Ubuntu)
Invalid
Undecided
Unassigned
libreoffice (Ubuntu)
Won't Fix
Wishlist
Unassigned
openoffice.org (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: openoffice.org

1_ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

2) apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.3.2-1ubuntu5
  Candidate: 1:3.3.2-1ubuntu5
  Version table:
 *** 1:3.3.2-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

LibreOffice 3.4.0
DEV300m103 (Build:5)

3) What is expected to happen in LibreOffice Calc via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/681080/+attachment/1743794/+files/OO_DCOUNT_problem_2.ods && localc -nologo OO_DCOUNT_problem_2.ods

is Sheet 1, cell B19's formula:

=DCOUNT(A4:E13,0,A16:E17)

throws an error as it is a malformed expression pointing to a non-existent column 0.

4) What happens instead is it erroneously yields 5. Occurs in both Ubuntu LO & 3.4.0 Beta.

WORKAROUND: Use Gnumeric as it throws an error.

apt-cache policy gnumeric
gnumeric:
  Installed: 1.10.13-1ubuntu1
  Candidate: 1.10.13-1ubuntu1
  Version table:
 *** 1.10.13-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/universe i386 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: openoffice.org-calc 1:3.2.0-7ubuntu4.1
ProcVersionSignature: Ubuntu 2.6.32-25.45-generic 2.6.32.21+drm33.7
Uname: Linux 2.6.32-25-generic i686
Architecture: i386
Date: Wed Nov 24 19:08:01 2010
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: openoffice.org

Revision history for this message
Christoph Arenz (arenz) wrote :
Revision history for this message
Christoph Arenz (arenz) wrote :
Revision history for this message
In , penalvch (penalvch) wrote :

Created attachment 46765
OO_DCOUNT_problem_2.ods

Downstream bug may be found at:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/681080

1_ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

2) apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.3.2-1ubuntu5
  Candidate: 1:3.3.2-1ubuntu5
  Version table:
 *** 1:3.3.2-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

LibreOffice 3.4.0
DEV300m103 (Build:5)

3) What is expected to happen in LibreOffice Calc via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/681080/+attachment/1743794/+files/OO_DCOUNT_problem_2.ods && localc -nologo OO_DCOUNT_problem_2.ods

is Sheet 1, cell B19's formula:

=DCOUNT(A4:E13,0,A16:E17)

throws an error as it is a malformed expression pointing to a non-existent column 0.

4) What happens instead is it erroneously yields 5. Occurs in both Ubuntu LO & 3.4.0 Beta.

Revision history for this message
penalvch (penalvch) wrote :

Christoph Arenz, thank you for reporting this bug and helping make Ubuntu better. Regarding the attached file opened using LibreOffice Calc via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/681080/+attachment/1743794/+files/OO_DCOUNT_problem_2.ods && localc -nologo OO_DCOUNT_problem_2.ods

1) notice Sheet 1, cell B19 has 5 when it should throw an error, as the formula:

=DCOUNT(A4:E13,0,A16:E17)

is pointing to a column of 0. Same issue with cell C50. This bug will focus on this issue.

Sheet1, Cells C32-C35 are malformed expressions as I converted them to Excel and they produced 0's all the way down. Please see Microsoft's website for information on DCOUNT syntax: http://office.microsoft.com/en-us/excel-help/dcount-HP005209049.aspx

lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.3.2-1ubuntu5
  Candidate: 1:3.3.2-1ubuntu5
  Version table:
 *** 1:3.3.2-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

apt-cache policy unoconv
unoconv:
  Installed: 0.3-6
  Candidate: 0.3-6
  Version table:
 *** 0.3-6 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/universe i386 Packages
        100 /var/lib/dpkg/status

apt-cache policy wine1.3
wine1.3:
  Installed: 1.3.19-0ubuntu1~maverick1~ppa1
  Candidate: 1.3.19-0ubuntu1~maverick1~ppa1
  Version table:
 *** 1.3.19-0ubuntu1~maverick1~ppa1 0
        100 /var/lib/dpkg/status
     1.3.15-0ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/universe i386 Packages

Changed in libreoffice (Ubuntu):
status: New → Confirmed
summary: - oocalc: wrong calculation with DCOUNT and DCOUNTA function
+ Calc DCOUNT function does not throw error in malformed expression
+ =DCOUNT(A4:E13,0,A16:E17)
penalvch (penalvch)
description: updated
tags: added: lo33
penalvch (penalvch)
description: updated
Revision history for this message
penalvch (penalvch) wrote : Re: Calc DCOUNT function does not throw error in malformed expression =DCOUNT(A4:E13,0,A16:E17)

Christoph Arenz, since this bug has enough information provided for a developer to begin work, I'm going to mark it Triaged and let them handle it from here. Thanks for taking the time to make Ubuntu better!

Changed in libreoffice (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Christoph Arenz (arenz) wrote :

Christopher, thanks for driving this forward!
I am not sure regarding your assessment of the expression being 'malformed'. I have taken the first example directly from the OO help document. There it says:
Syntax
DCOUNT(Database; DatabaseField; SearchCriteria)
For the DatabaseField parameter you can enter a cell to specify the column, or enter the number 0 for the entire database. The parameter cannot be empty. To reference a column by means of the column header name, place quotation marks around the header name.

Changed in df-libreoffice:
importance: Unknown → Low
status: Unknown → Confirmed
penalvch (penalvch)
Changed in gnumeric (Ubuntu):
status: New → Invalid
Revision history for this message
In , Markus Mohrhard (moggi) wrote :

this is not a bug

as http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_DCOUNT_function mentions 0 is used for all columns

Changed in df-libreoffice:
status: Confirmed → Invalid
Revision history for this message
In , penalvch (penalvch) wrote :

(In reply to comment #1)
> this is not a bug
>
> as
> http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_DCOUNT_function
> mentions 0 is used for all columns

<email address hidden>, as mentioned in the above link:
"Issues:

The exact use of 0 as the field parameter is unclear, both in operation and in compatibility (issue 84168)".

As well, Microsoft clears up what it means via:
http://office.microsoft.com/en-us/excel-help/dcount-HP005209049.aspx

The field parameter is not supposed to have a 0 in it as field is the column to use. A 0 column does not make sense. Hence, LO should throw an error for Excel compatibility reasons (Gnumeric also throws the error appropriately).

Changed in df-libreoffice:
status: Invalid → Confirmed
Revision history for this message
In , Markus Mohrhard (moggi) wrote :

No we are not Excel and we have our own formula api. As mentionen in the link I posted O is allowed and refers to all columns.

This is not a bug but a feature! We are not a excel copy so we don't need to behave in the same way.

Revision history for this message
In , penalvch (penalvch) wrote :

<email address hidden>, thank you for your attention on this issue.

(In reply to comment #3)
> No we are not Excel and we have our own formula api.

I never said LibreOffice was Excel.

> As mentionen in the link I posted O is allowed and refers to all columns.

While 0 is currently allowed, it does not hold compatibility with Excel or Gnumeric as noted in Comment #2.

> This is not a bug but a feature!

Ok, this bug has been remarked as ENHANCEMENT.

Changed in df-libreoffice:
importance: Low → Wishlist
penalvch (penalvch)
summary: - Calc DCOUNT function does not throw error in malformed expression
- =DCOUNT(A4:E13,0,A16:E17)
+ [Upstream] Calc DCOUNT function does not throw error in malformed
+ expression =DCOUNT(A4:E13,0,A16:E17)
Changed in openoffice.org (Ubuntu):
status: New → Won't Fix
Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote : migrating packaging from OpenOffice.org to Libreoffice

[This is an automated message.]
There are no new official OpenOffice.org releases in Ubuntu packaging anymore => Won't Fix

If the problem persists, please mark this bug as "also affects project Libreoffice" or "also affects distribution Libreoffice (Ubuntu)" if that has not happened already.

Please leave references to upstream OpenOffice.org bugs in place to allow cross pollination.

Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :

As per upstream https://bugs.freedesktop.org/show_bug.cgi?id=37256#c3:
"This is not a bug but a feature"
wontfix in Ubuntu, feel free to contribute uptsteam.

Changed in libreoffice (Ubuntu):
importance: Medium → Wishlist
status: Triaged → Won't Fix
Revision history for this message
In , Jmadero-dev (jmadero-dev) wrote :

As Markus already explained that this is a feature - it's not getting changed. Markus is one of our most experienced developers. Please don't reopen the bug.

Changed in df-libreoffice:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.