Bug 106749 - average and sum defaults in status bar return a wrong number when the range include a date
Summary: average and sum defaults in status bar return a wrong number when the range i...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.5.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-24 13:53 UTC by pajaro
Modified: 2017-04-17 17:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pajaro 2017-03-24 13:53:31 UTC
Description:
the status bar provides default calculations when selecting a range.

Instead of manually selecting a range, its not weird to select an entire row or column clicking on the top or left headers and that selects everything. Text is ignored for this purpose, and dates should be ignored or properly dealt with too

Steps to Reproduce:
1. add a date cell and number cell or 2 date cells
2. select date field and the other cell

Actual Results:  
weird average and sum numbers

Expected Results:
to ignore date fields, or to use a different default when dates are involved, like days betweed 2 dates, or whatever other useful result you can make up of 2 dates, just like average and sum are good defaults for numbers


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 m_a_riosv 2017-03-24 23:51:08 UTC
Because dates are numbers in the cells, and only the format makes they showed as dates. SUM doesn't take care of text even if it looks as number.
Comment 2 Buovjaga 2017-04-13 10:48:30 UTC
Yep, it's not a bug (double-checked with Eike). Closing.
Comment 3 pajaro 2017-04-13 13:45:24 UTC
Well, the bug is not about the sum not doing what its supposed to do, but about the status bar not showing a useful default value...

Which is what that space in the status bar is designed to do

It should show a useful default calculation. Like the sum of 2 dates, or difference in days of 2 dates or something. Something different to the default sum it does with numbers

Be free to disagree, but despite being a number internally, the user has decided that cell is a date and calc could detect the user decision and do something useful

Calc just decided to show garbage (useless calculation) instead of something useful

This is not a bug in the code, but a bug in usability and ui
Comment 4 Buovjaga 2017-04-17 16:20:28 UTC
Dates are internally time since epoch, so sum of dates does not make sense https://en.wikipedia.org/wiki/Unix_time
Comment 5 pajaro 2017-04-17 17:26:03 UTC
>> Well, the bug is not about the sum not doing what its supposed to do, but
>> about the status bar not showing a useful default value...

>Dates are internally time since epoch, so sum of dates does not make sense 

As I said, I know the sum of the internal representation of 2 dates is useless. It should be removed, instead of showing something useless :)

But we could actually show something useful there, like the difference of min and max dates... which is useful

- ex.1:
2017-04-10
2017-04-02
2017-04-01

Shows 10 days

- ex.2:
10:30
11:41

Shows 1h10'

And theres probably a few other useful calculations you can do with dates

If you want to discard it because is too difficult to implement with the current way cells works, okay, but at least acknowledge you are understanding what I mean with all this, because every reply makes me feel Im not making my point across :)
Comment 6 Buovjaga 2017-04-17 17:31:57 UTC
(In reply to pajaro from comment #5)
> If you want to discard it because is too difficult to implement with the
> current way cells works, okay, but at least acknowledge you are
> understanding what I mean with all this, because every reply makes me feel
> Im not making my point across :)

I understand what you mean. I am just relaying answers from experienced Calc developers. The last one was from Kohei.
Comment 7 pajaro 2017-04-17 17:35:37 UTC
Okay, so I did get my point across but Kohei does not think is useful enough

Now im at rest with this bug :)
Comment 8 pajaro 2017-04-17 17:36:14 UTC
Okay, so I did get my point across but Kohei does not think is useful enough

Now im at rest with this bug :)

Thanks for relaying the messages!