Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andibevan
 
Posts: n/a
Default Add st and th to dates

Hi All,

Is there a way in excel to format a date so that it automatically includes
the "th" and "st".

I.e. so 1/8/05 -- 1st August 2005?

Ta

Andi


  #2   Report Post  
CyberTaz
 
Posts: n/a
Default

Hello-

Excel provides no such date formatting, and trying to create a custom format
like that would be impossible due to the variable 'st', 'rd', 'th', etc. &
when each should be used.

Perhaps it can be accomplished with VBA, but unless someone has it available
& is willing to share, it would probably be more trouble to write than its
worth... Unless you need to use the dates for calculations.

Regards |:)

"Andibevan" wrote:

Hi All,

Is there a way in excel to format a date so that it automatically includes
the "th" and "st".

I.e. so 1/8/05 -- 1st August 2005?

Ta

Andi



  #3   Report Post  
Jim Cone
 
Posts: n/a
Default

Andi,

Chip Pearson can get you started...
http://www.cpearson.com/excel/ordinal.htm

Jim Cone
San Francisco, USA


"Andibevan" wrote in
message ...
Hi All,
Is there a way in excel to format a date so that it automatically includes
the "th" and "st".
I.e. so 1/8/05 -- 1st August 2005?
Ta
Andi


  #4   Report Post  
Dave O
 
Posts: n/a
Default

It's a little chunky, but this works:
=(IF(MOD((DAY(A1)),10)=1,DAY(A1)&"st",IF(MOD((DAY( A1)),10)=2,DAY(A1)&"nd",IF(MOD((DAY(A1)),10)=3,DAY (A1)&"rd",DAY(A1)&"th"))))&TEXT(A1,"
mmmm ")&YEAR(A1)

.... where your date is in A1.

  #5   Report Post  
Dave O
 
Posts: n/a
Default

Oops! The previously formula fails for the 11th, 12, and 13th. Use
this instead:
=(IF(INT(DAY(A1)/10)=1,DAY(A1)&"th",IF(MOD((DAY(A1)),10)=1,DAY(A1)& "st",IF(MOD((DAY(A1)),10)=2,DAY(A1)&"nd",IF(MOD((D AY(A1)),10)=3,DAY(A1)&"rd",DAY(A1)&"th")))))&TEXT( A1,"
mmmm ")&YEAR(A1)



  #6   Report Post  
CLR
 
Posts: n/a
Default

Nicely done Dave........

Vaya con Dios,
Chuck, CABGx3



"Dave O" wrote:

Oops! The previously formula fails for the 11th, 12, and 13th. Use
this instead:
=(IF(INT(DAY(A1)/10)=1,DAY(A1)&"th",IF(MOD((DAY(A1)),10)=1,DAY(A1)& "st",IF(MOD((DAY(A1)),10)=2,DAY(A1)&"nd",IF(MOD((D AY(A1)),10)=3,DAY(A1)&"rd",DAY(A1)&"th")))))&TEXT( A1,"
mmmm ")&YEAR(A1)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Dates Sue Excel Discussion (Misc queries) 1 July 22nd 05 12:29 PM
Using dates for x-axis values as string instead of creating a scale cs_weirdo Charts and Charting in Excel 2 June 17th 05 12:20 AM
Excel not recognizing Dates properly. Dan Excel Discussion (Misc queries) 1 March 23rd 05 07:19 PM
Formating Dates for production schedule dpl7579 Excel Discussion (Misc queries) 1 January 11th 05 08:43 PM
due dates Niki New Users to Excel 4 January 10th 05 04:11 PM


All times are GMT +1. The time now is 09:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"