'st' 'nd' 'rd' 'th' Format on Date

R1chard

Active Member
Joined
Jan 14, 2004
Messages
407
How can I format a cell to display the date in this format. Currently it will just display the number, 16 October 2007.

I want it to display 16th October 2007

Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
is there not a more basic cell format I could use?

My cell formula is =Today()

I want the date to display as 1st, 2nd etc rather than 1, 2.

Your reply seems to much for what I need.

Thanks for the help
 
Upvote 0
I don't think there's an easier way than to use

Code:
=DAY(TODAY())&IF(AND(MOD(DAY(TODAY()),100)>=10,MOD(DAY(TODAY()),100)<=14),"th",
CHOOSE(MOD(DAY(TODAY()),10)+1,"th","st","nd","rd","th","th","th","th","th","th")) &TEXT(TODAY()," MMMM YYYY")
instead of =TODAY()

Note that this will cause issues if you try to use it in future calculations (e.g. 5 days from now with = A1+5 won't work...)
 
Upvote 0
This is a little shorter...

=DAY(TODAY())&LOOKUP(DAY(TODAY()),{1,2,3,4,21,22,23,24,31;"st","nd","rd","th","st","nd","rd","th","st"})&TEXT(TODAY()," mmmm yyy")
 
Upvote 0
You wouldn't believe how many hours I've wasted trying to get that into one formula...

Sheesh .. Gonna have to find me a new past time...

;)
 
Upvote 0
Is there a way to achieve this using- Right click, custom formatting? I like to have; dddd, dd mmmm, Wednesday, 24th June 2015
 
Upvote 0
This is a little shorter...

=DAY(TODAY())&LOOKUP(DAY(TODAY()),{1,2,3,4,21,22,23,24,31;"st","nd","rd","th","st","nd","rd","th","st"})&TEXT(TODAY()," mmmm yyy")
And a little shorter still...

=DAY(TODAY())&MID("thstndrdth",MIN(9,2*RIGHT(A1)*(MOD(A1-11,100)>2)+1),2)&TEXT(TODAY()," mmmm yyyy")
 
Last edited:
Upvote 0
Is there a way to achieve this using- Right click, custom formatting? I like to have; dddd, dd mmmm, Wednesday, 24th June 2015

You can't do that directly with custom formats, but in Excel 2007 or later versions you can use a combination of conditional formatting and custom formats to achieve that effect, see this post by T. Valko (Biff)
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top