# 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.

edit retag close merge delete

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

( 2020-11-06 04:28:25 +0200 )edit

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.

( 2020-11-06 04:32:17 +0200 )edit

Will give that a try. Thank you!

( 2020-11-06 04:49:03 +0200 )edit

Sort by » oldest newest most voted

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).

Hope that helps.

more