Month and day with ordinals

Hi there, I was trying to figure out how to do a code that input Month and Day for LibreOffice Calc. I tried various methods that I found on this site but they came back with errors.

I want to do this way.

EG: November 5th

I even used this but it’s not the correct format code that I wanted.

=DAY(TODAY())&IF(OR(DAY(TODAY())={1;2;3;21;22;23;31}), CHOOSE(1*RIGHT(DAY(TODAY()),1),“st”,"nd ","rd "),"th ") &TEXT(TODAY(),“mmmm dd”)

It came back as 5th November 5

How can I solve this?

Thank you.

It looks as though you specified the date again at the end of your formula. Try this, I just deleted the dd to get=DAY(TODAY())&IF(OR(DAY(TODAY())={1;2;3;21;22;23;31}), CHOOSE(1*RIGHT(DAY(TODAY()),1),"st","nd ","rd "),"th ") &TEXT(TODAY(),"mmmm").

Add yyyy to get year , e.g. 5th November 2020

Whoops, I just re-read, you want

=TEXT(TODAY(),“mmmm”)&" "&DAY(TODAY())&IF(OR(DAY(TODAY())={1;2;3;21;22;23;31}), CHOOSE(1*RIGHT(DAY(TODAY()),1),“st”,"nd ","rd "),"th ")

for November 5th

I just changed comment because code broke in the middle.

Will give that a try. Thank you!

Hello,

format your date using Format Code [NatNum12 D=ordinal-number]MMMM D
(of course something like =TEXT(TODAY();"[NatNum12 D=ordinal-number]MMMM D") works as well, but it would turn the date into text).

Ref.: LibreOffice Help - Number Format Codes

Hope that helps.