Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
Excel date format trouble
That looks like it works. Do you mind telling me how?
thanks mb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel: I enter date and format for date, but shows as number | Excel Discussion (Misc queries) | |||
Format date in excel 2000 like '31st January 2005' | Excel Discussion (Misc queries) | |||
Keeping date format of a field inserted from an excel database | Excel Worksheet Functions | |||
Australian date format in Excel 2000 | Excel Discussion (Misc queries) | |||
Excel Default date for date format | Excel Discussion (Misc queries) |