Bug 170543 - Formatting Text(<nr>; "mmmm) function returns wrong result with month numbers
Summary: Formatting Text(<nr>; "mmmm) function returns wrong result with month numbers
Status: RESOLVED DUPLICATE of bug 158694
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-30 12:21 UTC by FlorianW
Modified: 2026-01-31 01:05 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
View with "show functions" (71.59 KB, image/png)
2026-01-30 12:29 UTC, FlorianW
Details
view showing the results (42.46 KB, image/png)
2026-01-30 12:30 UTC, FlorianW
Details
example file (14.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2026-01-31 01:03 UTC, Werner Tietz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FlorianW 2026-01-30 12:21:27 UTC
Description:
On alist with dates grouped by month, putting the related month's name has brought weird results. My function for each is =Text(<month-nr>; "mmmm")
Month  1 resulted in "Januar" (German for January)
Months 2..12 resulted each in "Dezember" (German for December).


Steps to Reproduce:
1. Put some date with month from Febraury to December
2. Use Month() function of the date
3. Use Text(<Month() result>; "mmmm")
4. check resulting formatted month' name

Actual Results:
1. Put some date with month from Febraury to December in say cell A1
2. Put =Month(A1) in cell B1
3. Put =Text(B1; "mmmm") in cell C3
4. check resulting formatted month' name in C3

Expected Results:
For Month(2) I expect formatted string to be Februar / february
...       3    - " - März / march
...       4    - " - 
... ... ... ... ... ...
...      11    - " - November
...      12    - " - Dezember / December


Reproducible: Always


User Profile Reset: No

Additional Info:
I don't have clue what you're expecting here... 
The help files don't include formatting a number with "mmmm".


If you appreciate additonal feedback, on the end of this bug report page, relating to attachments, you tell "once the bug is filled." Maybe you mean "the bug is filed" ?
Comment 1 FlorianW 2026-01-30 12:29:46 UTC
Created attachment 205271 [details]
View with "show functions"

I created a sample table for12 months, using the 1st day for each date.
The header shows the functions combined,
whlie the cell values the actual functions used.
Comment 2 FlorianW 2026-01-30 12:30:44 UTC
Created attachment 205272 [details]
view showing the results

Same as before, but cell values show the actual results
Comment 3 Mike Kaganski 2026-01-30 14:00:06 UTC
This is not a bug.

TEXT(...; "mmmm") does *not* give you a "name for a month number". I.e., its result is *not* expected to be "1 -> January", "2 -> February", ... "12 -> December". No, this is a *wrong* expectation.

What is *is* expected to produce, is "take the number from the first argument, consider is as a *date*, find that date's month, and show it as text".

Specifically, dates in Calc are represented as (maybe fractional) number of days since "epoch" - usually since 1899-12-30.

That means, that number 0 means "date 1899-12-30"; number 1 means "1899-12-31"; number 2 means "1900-01-01" ... and so on. Note that "number 1" is still in December 1899, and numbers 2 to 32 are all in January 1900.

Your formulas in column C should NOT be =TEXT(MONTH(date);"mmmm") - it should be =TEXT(date;"mmmm").
Comment 4 Werner Tietz 2026-01-30 14:10:46 UTC
!!Do NEVER mixup extracting the Month-number AND converting the result to Month-name!!

B1 ⇒  =TEXT(A1;"mmmm")

and its done!
Comment 5 FlorianW 2026-01-30 14:47:09 UTC
Thanks Mike Kaganski,

now it works fine.
Comment 6 FlorianW 2026-01-30 14:48:41 UTC
Werner Tietz, If do have a close look at my attachment showing the formulas, you'll see that you approach doesn't work.
The other question would be why should one use a function's result within another function? That doesn't make sense.
Comment 7 Mike Kaganski 2026-01-30 15:23:28 UTC

*** This bug has been marked as a duplicate of bug 158694 ***
Comment 8 Werner Tietz 2026-01-31 01:03:09 UTC
Created attachment 205284 [details]
example file
Comment 9 Werner Tietz 2026-01-31 01:05:42 UTC
(In reply to FlorianW from comment #6)
> Werner Tietz, If do have a close look at my attachment showing the formulas,
> you'll see that you approach doesn't work.
> The other question would be why should one use a function's result within
> another function? That doesn't make sense.

???

I'm telling the very same as Mike does!
look into attached file!