14.01.2017 u 08:55, Michael D. Setzer II je napisao/la:
Think the issue is that with "MMM", it treats the number as a date value
instead of as being a month, so that 1 would result in December, and 2-12
result in January.
So, the text option with month() doesn't seem to work at all, since the values
don't match. Here is using choose to get what I think. Longer formula, but it
seems to work, and would allow you do choose what exact format you want
for each month.
We all tried to to pass integer value (result of MONTH()) to a TEXT()
function which interpreted integer as number of days. Passing _date_
value does the job.
In documentation, MONTH() returns integer, and integer can not be
treated as date data type, it just a plain number.
Tony's suggestion is correct - it passes date value (data type) to
TEXT() function which calculates number of days passed since 1899-31-12
till now and returns correct result formated as "MMM".
So
= TEXT(NOW(), "MMM")
since OP wants it with NOW(), and Remy's suggestion seams longish now.
We were using TEXT() function wrong.
Number
'=CHOOSE(MONTH(A4),"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
1
Dec
2
Jan
3
Jan
4
Jan
5
Jan
6
Jan
7
Jan
8
Jan
9
Jan
10
Jan
11
Jan
12
Jan
Dates
'=CHOOSE(MONTH(A4),"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
01/01/17
Jan
02/02/17
Feb
03/06/17
Mar
04/07/17
Apr
05/09/17
May
06/10/17
Jun
07/12/17
Jul
08/13/17
Aug
09/14/17
Sep
10/16/17
Oct
11/17/17
Nov
12/19/17
Dec
On 13 Jan 2017 at 18:12, Remy Gauthier wrote:
Subject: Re: [libreoffice-users] Calculating MONTHNAME
From: Remy Gauthier <[email protected]>
To: Tanstaafl <[email protected]>,
[email protected]
Date sent: Fri, 13 Jan 2017 18:12:39 -0500
Hello,
Day "1" is December 31, 1899 (at least, this is what I get when I
display "1" with a YYYY-MM-DD format): this is why
'TEXT(MONTH(NOW()),"MMM")"' gives "December". To get something like
this to come out consistently, I always use a formula like this:
=TEXT(DATE(1900;MONTH(NOW());1);"MMM") [basically asking for the month
of Jan 1, 1900]
In this case, the formula is not influenced by the date encoding scheme
and will yield the desired result.
I hope this helps.
Rémy Gauthier.
Le vendredi 13 janvier 2017 à 15:17 -0500, Tanstaafl a écrit :
If it is its been there a long time, because I first encountered this
a
loooong time ago (I finally decided to ask about it).
Would appreciate someone confirming I'm not just crazy, and it should
work as I'm expecting.
On Fri Jan 13 2017 15:12:50 GMT-0500 (Eastern Standard Time), Joe
Conner
<[email protected]> wrote:
Bug???
On 01/13/2017 12:05 PM, Tanstaafl wrote:
Ok, this is really driving me nuts...
Given:
=MONTH(NOW())
results in the number of the current month (1, for January)
I want to simply translate this to the monthname, so I used:
=TEXT(MONTH(NOW()),"MMM")
this almost gives me what I want, but it results in "Dec',
instead of
"Jan" - WTF???
Changing it to:
=TEXT(MONTH(NOW())+1,"MMM")
gives me "Jan", which is what I want.
Why do I have to add a '1' to it???
--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted