Issue 124844 - Calculation results with Date result like "=TODAY()+ number" should show date format
Summary: Calculation results with Date result like "=TODAY()+ number" should show date...
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: formatting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Minor (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-07 13:39 UTC by Oliver Specht
Modified: 2014-05-17 07:06 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Sample: date() not work (43.16 KB, application/vnd.sun.xml.calc)
2014-05-16 10:51 UTC, Rainer Bielefeld
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Oliver Specht 2014-05-07 13:39:57 UTC
Insert a formula "=TODAY()"
-> The cell automatically gets a date format
insert the formula "=TODAY() + 1" into another cell
-> Only the value is inserted

The result format of functions should be kept in calculations as long as it is possible.
Comment 1 Rainer Bielefeld 2014-05-07 17:14:58 UTC
I'm afraid that's not easy, and I am absolutely sure that it's not common sense that all formulas with "today()" in it should show a date as result. 

Reporter's sample is plausible, what what if someone simply wants to calculate the number of passed days this year with "=today()-(date(2014;01;01)"? He does not want a date, but an integer as result.

Behavior was already the same with OOo 3.1.1

@Oliver Specht
Can you please contribute a more detailed and complete concept 
(a) In what cases date result and in what not
(b) comparison with competitors
(c) comparison with other units (currency)?
Comment 2 Rainer Bielefeld 2014-05-08 07:22:59 UTC
I currently see improvement required for functions "=today()+1 intiger" to simulate functions "=tomorrow()", "=yesterday()" and similar.

That also would be useful for =eastersunday(), where =eastersunday() will be shown as date, but calculated other related public holidays as integer number.

So the request should be for all calculations with Date functions what have a date as result and where only a single number becomes added or subtracted.

@Oliver Specht:
What do you think?
Comment 3 Oliver Specht 2014-05-08 07:43:53 UTC
I agree. Thats what the competition does.
Comment 4 Rainer Bielefeld 2014-05-15 05:57:57 UTC
=date() also is one of the affected functions what also should show function +- integer with date format
Comment 5 mroe 2014-05-16 09:47:06 UTC
(In reply to Rainer Bielefeld from comment #4)
> =date() also is one of the affected functions what also should show function
> +- integer with date format

For DATE() it works and you get a date value. Try it.

And it works also for TIME(); try =TIME(12;13;14)+1. But the problem is, that you will see no difference to =TIME(12;13;14) because of the format "HH:MM:SS". Should it be better "[HH]:MM:SS"? What does the user want? Calc know it?
Comment 6 Rainer Bielefeld 2014-05-16 10:51:50 UTC
Created attachment 83403 [details]
Sample: date() not work

(In reply to mroe from comment #5)
Of course I tested, see sample document with screenshot. What is your result with that document?

Can you please attach a sample document where that worked for you so that we can examine that strange difference?
Comment 7 Rainer Bielefeld 2014-05-16 11:21:00 UTC
(In reply to mroe from comment #5)
> And it works also for TIME(); try =TIME(12;13;14)+1. But the problem is,

I don 't think that we should worry about such special cases, user can apply a cell formatting if required.
Comment 8 mroe 2014-05-16 14:11:58 UTC
Sorry, my fault. I tried first =Date(…); then I changed it to =Date(…)+1. In this case it stays as date.

> > And it works also for TIME(); try =TIME(12;13;14)+1. But the problem is,

> I don 't think that we should worry about such special cases, user can apply a cell formatting if required.

All cases are special cases. And every "automagic" behaviour satisfies always only a (lesser or bigger) piece of users.

In addition to issue 124807: Changing a format should only be acceptable for unformatted cells. Especially if a cell style with a number format is applied to a cell only _this_ number format should be used and not been overwritten!
Comment 9 Rainer Bielefeld 2014-05-16 16:33:24 UTC
(In reply to mroe from comment #8)
> I tried first =Date(…); then I changed it to =Date(…)+1. In
> this case it stays as date.

Strange, not for me  with "AOO 4.0.1 – German UI / German locale [AOO401m3(Build:9712) - Rev. 1520285 2013-09-05 13:52:01]" on German WIN7 Home Premium (64bit)", Common 4.0 User Profile, where format changes to integer number. But with a fix here that would become uninteresting.
Comment 10 mroe 2014-05-17 07:06:50 UTC
Curious. I'm sure I tried it yesterday before I answered. I tried it in your test document and in a new blank document. And the date stays as described. But today I also cannot reproduce my own research. :-(