Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
moranbo
 
Posts: n/a
Default 2 digit year in dates return 19xx not 20xx


Dates entered with just the last two digits are handled in Excel as
follows: between 00 and 29 are treated as 2000 to 2029; between 30 and
99 are treated as 1930 to 1999. It is possible to make an adjustment
in Windows under Regional settings in Control Panel so that manual
entry of dates in a spreadsheet with two digits will properly convert
to 2000.

My problem is that the adjustment in Regional settings noted above does
not apply to the text to column process in a macro. The input text file
contains only two digit years (and the file cannot be changed to four
digit years which would be the easy fix). The text file contains only
dates meant to reflect dates after 2005 but the text to column process
treats two digit dates in that file that are between 30 and 99 as 19xx,
not 20xx.

I could write a macro to change the 19xx dates to 20xx but wanted to
know if there is another way to tell Excel to use 20xx.


--
moranbo
------------------------------------------------------------------------
moranbo's Profile: http://www.excelforum.com/member.php...o&userid=27036
View this thread: http://www.excelforum.com/showthread...hreadid=445590

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I couldn't find anything that would change this behavior (in xl2003).

But an alternative to the macro would be a formula that parses the string the
way you want.



moranbo wrote:

Dates entered with just the last two digits are handled in Excel as
follows: between 00 and 29 are treated as 2000 to 2029; between 30 and
99 are treated as 1930 to 1999. It is possible to make an adjustment
in Windows under Regional settings in Control Panel so that manual
entry of dates in a spreadsheet with two digits will properly convert
to 2000.

My problem is that the adjustment in Regional settings noted above does
not apply to the text to column process in a macro. The input text file
contains only two digit years (and the file cannot be changed to four
digit years which would be the easy fix). The text file contains only
dates meant to reflect dates after 2005 but the text to column process
treats two digit dates in that file that are between 30 and 99 as 19xx,
not 20xx.

I could write a macro to change the 19xx dates to 20xx but wanted to
know if there is another way to tell Excel to use 20xx.

--
moranbo
------------------------------------------------------------------------
moranbo's Profile: http://www.excelforum.com/member.php...o&userid=27036
View this thread: http://www.excelforum.com/showthread...hreadid=445590


--

Dave Peterson
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
How can I use day of year dates in Excel? jbradford721 Excel Discussion (Misc queries) 2 August 18th 05 02:56 PM
Date formula: return Quarter and Fiscal Year of a date Rob Excel Discussion (Misc queries) 7 May 11th 05 08:48 PM
Return a digit in a string of numbers W M Excel Discussion (Misc queries) 5 May 11th 05 06:51 PM
How sort dates just by day/month and NOT year if all 3 given in ce smags Excel Worksheet Functions 1 January 25th 05 03:45 AM
Seach Column and return multiple dates to another worksheet? Mcasteel Excel Worksheet Functions 0 November 10th 04 07:41 PM


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