Apache OpenOffice (AOO) Bugzilla – Issue 124844
Calculation results with Date result like "=TODAY()+ number" should show date format
Last modified: 2014-05-17 07:06:50 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.
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)?
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?
I agree. Thats what the competition does.
=date() also is one of the affected functions what also should show function +- integer with date format
(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?
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?
(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.
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!
(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.
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. :-(