Bug 140672 - Undefined values (empty cell) being treated as zero in table formulas
Summary: Undefined values (empty cell) being treated as zero in table formulas
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Tables-Formulas
  Show dependency treegraph
 
Reported: 2021-02-25 21:53 UTC by Ulrich Windl
Modified: 2024-05-09 13:16 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot showing a table with undefined cells (using min, man, and mean) (9.46 KB, image/png)
2021-02-25 21:53 UTC, Ulrich Windl
Details
Example Document (24.28 KB, application/vnd.oasis.opendocument.text)
2021-05-16 18:49 UTC, Ulrich Windl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2021-02-25 21:53:45 UTC
Created attachment 170065 [details]
Screenshot showing a table with undefined cells (using min, man, and mean)

As opposed to Calc, Writer treats missing cell data as zero.
That makes it hard to use functions like min, max or mean (the min will mostly be zero for positive values, max will be zero for negative values, and the mean will typically be too small.
See attached screen shot for a real-life example (measurement data when not all measurements were made).
Comment 1 himajin100000 2021-03-05 13:46:52 UTC
FWIW:

In current implementation, the only functions that ignore the empty cells are "AVERAGE","COUNT", and "PRODUCT". 
(i.e. When I create a 1-row and 3-column table, and input 1 to A1, =AVERAGE(<A1:B1>) to C1 and keep the B1 cell empty, the avearge value will be 1, not (1 + 0) /2 = 0.5)

https://opengrok.libreoffice.org/xref/core/sw/source/core/fields/cellfml.cxx?r=94306083&fi=MakeFormula_#360

https://opengrok.libreoffice.org/xref/core/sw/source/core/fields/cellfml.cxx?r=94306083&fi=MakeFormula_#376
Comment 2 Xisco Faulí 2021-05-10 16:15:03 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 3 Ulrich Windl 2021-05-16 18:49:44 UTC
Created attachment 172069 [details]
Example Document

This example document should match the screenshot.
Comment 4 Buovjaga 2022-04-26 11:13:45 UTC
I confirm

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 37613bffe4621c444e5a34678bafb2c3a875263d
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 26 April 2022
Comment 5 QA Administrators 2024-04-26 03:18:02 UTC
Dear Ulrich Windl,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug