Description: I want to display the current month name from a date-formatted cell. I am using the TEXT function as follows: =TEXT(month(cell-id),"MMMM"). Cell-id is the cell containing the date. Steps to Reproduce: 1.Enter 1/1/23 in cell A1, 1/2/23 in A2, 1/3/23 in A3, etc until 1/12/23 in A12. 2.Enter =MONTH(A1) in B1, =MONTH(A2) in B2, and copy down to MONTH(A12) in B12. 3.Enter =TEXT(B1,"MMMM") in C1. Copy down to and including C12. Actual Results: C1 shows "December". C2 - C12 all show "January". Expected Results: C1 should show January, C2 February, C3 March and so on down to C12 which should show December. Reproducible: Always User Profile Reset: Yes Additional Info: Version: 7.6.4.1 (X86_64) / LibreOffice Community Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1 CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win Locale: en-AU (en_AU); UI: en-GB Calc: threaded
Created attachment 191419 [details] Spreadsheet demonstrating the bug. If you need any further information or evidence from me, please contact me.
MMMM format code in TEXT function expects that the number that is being formatted is a *date* (i.e., a number of days since the date defined at Options->Calc->Calculate, by default 1899-12-30). But you pass there a number returned by MONTH function, i.e. an integer between 1 and 12. Your formula should be =TEXT(cell-id,"MMMM")
*** Bug 170543 has been marked as a duplicate of this bug. ***