Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Entering dates into cells as mm/yy or yy

The cell format has be set as a Custom format mm/yy.

When entering dates into cells as mm/yy Excel interprets 12/96 as 01/12/96
(dd/mm/yy English format) BUT if you enter 12/06 it enterprets it as 12/06/07
and displays it as 06/07. IE Excel is interpreting 12/06 as dd/mm and
defaulting the current year.

Is there any way of getting excel to accept post 1999 years entered as yy?

This is part of an electronic questionnaire so the data entry has to be
completely idiot proof. I don't want to use yyyy or a format that needs the
days. Nor do I want to use macros or dummy columns if I can help it.

Any thoughts most welcome!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Entering dates into cells as mm/yy or yy

I am not privy to the inner workings of XL so the below is my interpretation
of what I get:

When presented with a "part date" like 12/96 XL tries to interpreit it into
a whole date by trying to add the current year. 12/96/2007 is obviously not
a real date so XL knows tries to make the date by adding day number 1 to
give 1/12/1996

For ambiguous dates like your 12/06 which *could* be 1/12/1906, 1/12/2006,
or 12/6/2007 XL goes through it procedure of adding the current year then a
day until is finds a acceptable date and the first one that it comes across
is 12/06/2007.

The only answer to ambiguous dates is to make them specific so that there is
no doubt what it was that you intended and that needs yyy or VBA

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"dabarr" wrote in message
...
The cell format has be set as a Custom format mm/yy.

When entering dates into cells as mm/yy Excel interprets 12/96 as 01/12/96
(dd/mm/yy English format) BUT if you enter 12/06 it enterprets it as
12/06/07
and displays it as 06/07. IE Excel is interpreting 12/06 as dd/mm and
defaulting the current year.

Is there any way of getting excel to accept post 1999 years entered as yy?

This is part of an electronic questionnaire so the data entry has to be
completely idiot proof. I don't want to use yyyy or a format that needs
the
days. Nor do I want to use macros or dummy columns if I can help it.

Any thoughts most welcome!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Entering dates into cells as mm/yy or yy

Format the cells as Text when the responders enter data into the electronic
questionnaire. Then use a small macro to change the text into a true date
when the results are analyzed:

Sub date_maker()
Dim dd As Date
For Each r In Selection
With r
v = .Value
dd = DateSerial(2000 + Right(v, 2), Left(v, 2), 1)
.Clear
.NumberFormat = "mm/yy"
.Value = dd
End With
Next
End Sub

--
Gary''s Student - gsnu200741


"dabarr" wrote:

The cell format has be set as a Custom format mm/yy.

When entering dates into cells as mm/yy Excel interprets 12/96 as 01/12/96
(dd/mm/yy English format) BUT if you enter 12/06 it enterprets it as 12/06/07
and displays it as 06/07. IE Excel is interpreting 12/06 as dd/mm and
defaulting the current year.

Is there any way of getting excel to accept post 1999 years entered as yy?

This is part of an electronic questionnaire so the data entry has to be
completely idiot proof. I don't want to use yyyy or a format that needs the
days. Nor do I want to use macros or dummy columns if I can help it.

Any thoughts most welcome!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Entering dates into cells as mm/yy or yy

Gary"s Student,

If youwill forgive a sugestion for alteration to your code, form the OP:

Is there any way of getting excel to accept post 1999 years entered as yy?


To accommodate date per 1999:

Option Explicit
Sub date_maker()
Dim dd As Date
Dim r As Range
Dim v As String
Dim Century As Long

Century = 2000

For Each r In Selection
With r
v = .Value
If Right(v, 2) 30 Then Century = 1900
dd = DateSerial(Century + Right(v, 2), Left(v, 2), 1)
.Clear
.NumberFormat = "mm/yy"
.Value2 = dd
End With
Next
End Sub

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gary''s Student" wrote in message
...
Format the cells as Text when the responders enter data into the
electronic
questionnaire. Then use a small macro to change the text into a true date
when the results are analyzed:

Sub date_maker()
Dim dd As Date
For Each r In Selection
With r
v = .Value
dd = DateSerial(2000 + Right(v, 2), Left(v, 2), 1)
.Clear
.NumberFormat = "mm/yy"
.Value = dd
End With
Next
End Sub

--
Gary''s Student - gsnu200741


"dabarr" wrote:

The cell format has be set as a Custom format mm/yy.

When entering dates into cells as mm/yy Excel interprets 12/96 as
01/12/96
(dd/mm/yy English format) BUT if you enter 12/06 it enterprets it as
12/06/07
and displays it as 06/07. IE Excel is interpreting 12/06 as dd/mm and
defaulting the current year.

Is there any way of getting excel to accept post 1999 years entered as
yy?

This is part of an electronic questionnaire so the data entry has to be
completely idiot proof. I don't want to use yyyy or a format that needs
the
days. Nor do I want to use macros or dummy columns if I can help it.

Any thoughts most welcome!




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Entering dates into cells as mm/yy or yy

A very clever suggestion ! I'll keep it for my personal toolbox.
--
Gary''s Student - gsnu200741


"Sandy Mann" wrote:

Gary"s Student,

If youwill forgive a sugestion for alteration to your code, form the OP:

Is there any way of getting excel to accept post 1999 years entered as yy?


To accommodate date per 1999:

Option Explicit
Sub date_maker()
Dim dd As Date
Dim r As Range
Dim v As String
Dim Century As Long

Century = 2000

For Each r In Selection
With r
v = .Value
If Right(v, 2) 30 Then Century = 1900
dd = DateSerial(Century + Right(v, 2), Left(v, 2), 1)
.Clear
.NumberFormat = "mm/yy"
.Value2 = dd
End With
Next
End Sub

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gary''s Student" wrote in message
...
Format the cells as Text when the responders enter data into the
electronic
questionnaire. Then use a small macro to change the text into a true date
when the results are analyzed:

Sub date_maker()
Dim dd As Date
For Each r In Selection
With r
v = .Value
dd = DateSerial(2000 + Right(v, 2), Left(v, 2), 1)
.Clear
.NumberFormat = "mm/yy"
.Value = dd
End With
Next
End Sub

--
Gary''s Student - gsnu200741


"dabarr" wrote:

The cell format has be set as a Custom format mm/yy.

When entering dates into cells as mm/yy Excel interprets 12/96 as
01/12/96
(dd/mm/yy English format) BUT if you enter 12/06 it enterprets it as
12/06/07
and displays it as 06/07. IE Excel is interpreting 12/06 as dd/mm and
defaulting the current year.

Is there any way of getting excel to accept post 1999 years entered as
yy?

This is part of an electronic questionnaire so the data entry has to be
completely idiot proof. I don't want to use yyyy or a format that needs
the
days. Nor do I want to use macros or dummy columns if I can help it.

Any thoughts most welcome!





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
Entering Dates kmkx70a Excel Discussion (Misc queries) 3 January 22nd 07 03:03 AM
entering dates Ed Excel Discussion (Misc queries) 1 November 26th 06 05:42 PM
Entering dates instructorjml Excel Discussion (Misc queries) 3 March 31st 06 08:20 PM
Entering dates Hoddros Excel Discussion (Misc queries) 1 February 20th 06 03:24 PM
Dates in 2005 format cells are not entering correctly. snixflowergirl Excel Worksheet Functions 2 January 5th 05 05:13 PM


All times are GMT +1. The time now is 11:17 AM.

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

About Us

"It's about Microsoft Excel"