Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 46
Default How to specify this date format?

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?

--
Terry, East Grinstead, UK
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default How to specify this date format?

On Sat, 20 Dec 2008 14:58:38 +0000, Terry Pinnell
wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?



Try a Custom cell format

DDD DD\th MMM, YYYY

It will however always display "ht" after the data, like 1th and 2th
instead of 1st and 2nd as you probably want.

Hope this helps / Lars-Åke
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default How to specify this date format?

Select the range of cells, press Ctrl+1 (numeral one) to open the Format
dialog, and on the Numbers tab select an appropriate Date format, or design
your own.

'Saturday 20th December, 2008' is the result of a format of

dddd dd"th" mmmm, yyyy

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Terry Pinnell" wrote in message
...
Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?

--
Terry, East Grinstead, UK



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default How to specify this date format?

One way:

Format/Cells/Number/Custom "ddd dd mmmm yyyy"



In article ,
Terry Pinnell wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default How to specify this date format?

Note that you'll also see

Monday 01th December, 2008

and

Wednesday 03th December, 2008


using that format.


In article ,
"Jon Peltier" wrote:

'Saturday 20th December, 2008' is the result of a format of

dddd dd"th" mmmm, yyyy



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to specify this date format?

You won't get the indicator (1st, 2nd, 3rd, 4th, ...), but you could try a
custom number format of:

ddd dd mmmm yyyy
or
dddd dd mmmm, yyyy



Terry Pinnell wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?

--
Terry, East Grinstead, UK


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default How to specify this date format?

You can't format a cell to display ordinal suffixes (the st, nd, rd, th
ending), but you can do what you want via a formula in another cell.
Assuming your date is in A2, put this formula wherever you want...

=TEXT(A2,"dddd
")&DAY(A2)&MID("thstndrdth",MIN(9,2*RIGHT(DAY(A2)) *(MOD(DAY(A2)-11,100)2)+1),2)&TEXT(A2,"
mmmm, yyyy")

This formula can be copied down or across if needed.

--
Rick (MVP - Excel)


"Terry Pinnell" wrote in message
...
Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?

--
Terry, East Grinstead, UK


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to specify this date format?

You could do it with event code behind the sheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If IsDate(.Value) Then
Select Case Day(.Value)
Case 1, 21, 31
.NumberFormat = "dddd d""st"" mmm, yyyy"
Case 2, 22
.NumberFormat = "dddd d""nd"" mmm, yyyy"
Case 3, 23
.NumberFormat = "dddd d""rd"" mmm, yyyy"
Case 4 To 20, 24 To 30
.NumberFormat = "dddd d""th"" mmm, yyyy"
End Select
End If
End With
End Sub


Gord Dibben MS Excel MVP

On Sat, 20 Dec 2008 14:58:38 +0000, Terry Pinnell
wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default How to specify this date format?

A minor simplification. Change this statement...

Case 4 To 20, 24 To 30

to this...

Case Else

Also, the OP may want to filter the event for certain cells only...

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Range("C4:H9")) Is Nothing Then Exit Sub
With Target
If IsDate(.Value) Then
Select Case Day(.Value)
Case 1, 21, 31
.NumberFormat = "dddd d""st"" mmm, yyyy"
Case 2, 22
.NumberFormat = "dddd d""nd"" mmm, yyyy"
Case 3, 23
.NumberFormat = "dddd d""rd"" mmm, yyyy"
Case Else
.NumberFormat = "dddd d""th"" mmm, yyyy"
End Select
End If
End With
End Sub

Note to the OP... my example used the range C4:H9 to apply this event code
to; this was accomplished via the Range property call in the first line of
the code... change that range to suit your needs.

--
Rick (MVP - Excel)


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
You could do it with event code behind the sheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If IsDate(.Value) Then
Select Case Day(.Value)
Case 1, 21, 31
.NumberFormat = "dddd d""st"" mmm, yyyy"
Case 2, 22
.NumberFormat = "dddd d""nd"" mmm, yyyy"
Case 3, 23
.NumberFormat = "dddd d""rd"" mmm, yyyy"
Case 4 To 20, 24 To 30
.NumberFormat = "dddd d""th"" mmm, yyyy"
End Select
End If
End With
End Sub


Gord Dibben MS Excel MVP

On Sat, 20 Dec 2008 14:58:38 +0000, Terry Pinnell
wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to specify this date format?

On Sat, 20 Dec 2008 14:58:38 +0000, Terry Pinnell
wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?


Since the format of the cell needs to change dynamically depending on it's
contents, you could use an event triggered macro.

One way to do this:

Right click on the sheet tab.

Select View Code and paste the code below into the window that opens.

The code is set so that date entries in column A will be converted to display
in your desired, ordinal format.

=====================================
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sFmt As String
Dim sSuffix As String
Dim c As Range, rg As Range
Const sFmtB As String = "dddd x mmmm, yyyy"
'sets Col A to have ordinal date format
Set rg = Range("A:A")

If Not Intersect(Target, rg) Is Nothing Then
Application.EnableEvents = False
For Each c In Intersect(Target, rg)
If IsDate(c.Value) Then
Select Case Day(c.Value)
Case Is = 1, 21, 31
sSuffix = "st"
Case Is = 2, 22
sSuffix = "nd"
Case Is = 3, 23
sSuffix = "rd"
Case Else
sSuffix = "th"
End Select
sSuffix = """" & sSuffix & """"

sFmt = Replace(sFmtB, "x", "d" & sSuffix)
c.NumberFormat = sFmt
End If
Next c
End If
Application.EnableEvents = True
End Sub
====================================

--ron


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 46
Default How to specify this date format?

JE McGimpsey wrote:

One way:

Format/Cells/Number/Custom "ddd dd mmmm yyyy"



In article ,
Terry Pinnell wrote:

Is there any way to specify that a date entered as say 20/12/08 should
be displayed in Excel 2000 as 'Sat 20 December 2008' please? Even
better, 'Saturday 20th December, 2008'?


Thanks all, much appreciated. I've gone for "ddd dd mmmm yyyy" for the
time being but will try the more complex alternatives later.

--
Terry, East Grinstead, UK
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
convert serial date format to normal date format Flagworld Excel Discussion (Misc queries) 3 September 23rd 08 01:32 PM
Convert date from text format to date format Anita Excel Discussion (Misc queries) 3 June 4th 07 11:57 AM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
Can I change a date with no format (20051111) to date format? Rose New Users to Excel 2 November 11th 05 09:03 PM
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM


All times are GMT +1. The time now is 10:35 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"