Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
michaelberrier
 
Posts: n/a
Default Excel date format trouble

I am using a magnetic stripe reader to enter a DL expiration date into
a cell. The date on the stripe is formatted as YYMM, so April of 2006
would look like 0604. The trouble comes when I want to compare that
date to today's to automatically detect an expired document.

Excel will allow a date in that format as long as it is entered that
way to start with. Otherwise, Excel will interpret the number 0604 as
six hundred four days after Jan 1, 1900.

If the cell is fomatted to show the date as YYMM, then the number 0604
returns a date of 0108, or August of 1901.

Is there any way to make Excel see an entered string of numbers as a
previously formatted date?

Thanks for any help

  #2   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default Excel date format trouble

But to do that you need to have a day in April to compare with today's date?

If we assume that day is the 1st

=TODAY()--TEXT(REPT("0",4-LEN(A1))&A1&"01","\2\000-00-00")


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com






"michaelberrier" wrote in message
oups.com...
I am using a magnetic stripe reader to enter a DL expiration date into
a cell. The date on the stripe is formatted as YYMM, so April of 2006
would look like 0604. The trouble comes when I want to compare that
date to today's to automatically detect an expired document.

Excel will allow a date in that format as long as it is entered that
way to start with. Otherwise, Excel will interpret the number 0604 as
six hundred four days after Jan 1, 1900.

If the cell is fomatted to show the date as YYMM, then the number 0604
returns a date of 0108, or August of 1901.

Is there any way to make Excel see an entered string of numbers as a
previously formatted date?

Thanks for any help



  #3   Report Post  
Posted to microsoft.public.excel.misc
michaelberrier
 
Posts: n/a
Default Excel date format trouble

That looks like it works. Do you mind telling me how?

thanks
mb

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: I enter date and format for date, but shows as number spohar Excel Discussion (Misc queries) 2 March 10th 06 09:40 PM
Format date in excel 2000 like '31st January 2005' Malcolm Agingwell Excel Discussion (Misc queries) 1 June 29th 05 11:01 AM
Keeping date format of a field inserted from an excel database Tim Cossins Excel Worksheet Functions 1 May 21st 05 12:49 AM
Australian date format in Excel 2000 Brian Jones Excel Discussion (Misc queries) 2 March 30th 05 06:13 AM
Excel Default date for date format smurphy123 Excel Discussion (Misc queries) 3 January 23rd 05 10:39 PM


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