View Single Post
  #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