Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Wendy D
 
Posts: n/a
Default Can Excel express a date with ordinals?

Wondering if excel can express mmm dd dates including their ordinal?
Examples a May 4th, October 1st, June 3rd.

Thanks!
Wendy
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Wendy,

For a date in A1:

=TEXT(A1,"mmmm ") &
IF(DAY(A1)0,DAY(A1)&IF(AND(DAY(A1)10,DAY(A1)<20) ,"th",CHOOSE(MOD(DAY(A1),10)+1,"th","st","nd","rd" ,"th","th","th","th","th","th")),"")

HTH,
Bernie
MS Excel MVP


"Wendy D" wrote in message
...
Wondering if excel can express mmm dd dates including their ordinal?
Examples a May 4th, October 1st, June 3rd.

Thanks!
Wendy



  #3   Report Post  
David Billigmeier
 
Posts: n/a
Default

Format-Cells-'Number' tab-Click on "Custom" and type this formula:

[$-409]mmmm d


--
Regards,
Dave


"Wendy D" wrote:

Wondering if excel can express mmm dd dates including their ordinal?
Examples a May 4th, October 1st, June 3rd.

Thanks!
Wendy

  #4   Report Post  
Wendy D
 
Posts: n/a
Default

Dave, that's the type of thing I'm looking for (although I will try the other
suggestion if I don't find anything this easy), however when I use that in
the custom field, I don't get the ordinals, only the full month. EX: I get
Jaunary 4, not January 4th. Do you know what else to add?

Thanks!

"David Billigmeier" wrote:

Format-Cells-'Number' tab-Click on "Custom" and type this formula:

[$-409]mmmm d


--
Regards,
Dave


"Wendy D" wrote:

Wondering if excel can express mmm dd dates including their ordinal?
Examples a May 4th, October 1st, June 3rd.

Thanks!
Wendy

  #5   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Wendy,

You can't do it through formatting, which is why I posted a formula.

HTH,
Bernie
MS Excel MVP


"Wendy D" wrote in message
...
Dave, that's the type of thing I'm looking for (although I will try the other
suggestion if I don't find anything this easy), however when I use that in
the custom field, I don't get the ordinals, only the full month. EX: I get
Jaunary 4, not January 4th. Do you know what else to add?

Thanks!

"David Billigmeier" wrote:

Format-Cells-'Number' tab-Click on "Custom" and type this formula:

[$-409]mmmm d


--
Regards,
Dave


"Wendy D" wrote:

Wondering if excel can express mmm dd dates including their ordinal?
Examples a May 4th, October 1st, June 3rd.

Thanks!
Wendy





  #6   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Fri, 30 Sep 2005 12:38:03 -0700, "Wendy D"
wrote:

Wondering if excel can express mmm dd dates including their ordinal?
Examples a May 4th, October 1st, June 3rd.

Thanks!
Wendy


You can Bernie's formula, which results in a text string difficult to use in
further calculations.

You could also use an event triggered macro to change the format appropriately
"on the fly" as it were. This has the advantage of preserving the
characteristics of the entry as a "date". It won't work as written, however,
if the entry is dependent on some cell entry from another worksheet.

One way to set this up:

Right click on the worksheet tab.
Select View Code from the dropdown menu.
Paste the code below into the window that opens.

=============================
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim aoi As Range, c As Range
Dim Suffix As String

Set aoi = [a1:a100] 'set this to where you might be entering dates

On Error GoTo Handler

If Not Intersect(Target, aoi) Is Nothing Or _
Not Intersect(Target.Dependents, aoi) Is Nothing Then

For Each c In aoi
If IsDate(c.Value) Then
Select Case Day(c.Value)
Case Is = 1, 21, 31
Suffix = "\s\t"
Case Is = 2, 22
Suffix = "\n\d"
Case Is = 3, 23
Suffix = "\r\d"
Case Else
Suffix = "\t\h"
End Select

c.NumberFormat = "mmm d" & Suffix & " yyyy"
End If
Next c

End If
Exit Sub

Handler: If Not Intersect(Target, aoi) Is Nothing Then Resume Next
If Err.Description < "No cells were found." Then
MsgBox ("Error #" & Err & " " & Err.Description)
End If
End Sub
============================
--ron
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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
today's date in excel David Excel Discussion (Misc queries) 2 June 2nd 05 01:15 PM
Excel Query Wizard Date Format aldsv Excel Discussion (Misc queries) 1 May 31st 05 12:44 PM
Excel file modification date GROSNER Excel Discussion (Misc queries) 5 March 4th 05 01:19 AM


All times are GMT +1. The time now is 05:19 PM.

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"