Getting date stored as text into real date?

E

Ed from AZ

A database query program outputs everything as a text string. One of
the fields is a date, formatted as yyyymmdd. Is there a worksheet
function that will change this to an Excel-recognized date? Or a
macro? The error checking doesn't flag this.

Ed
 
P

Pete_UK

With your text date in A1, try this in B1:

=DATE(LEFT(A1,4),MID(A1,5,2),(RIGHT(A1,2))

Hope this helps.

Pete
 
J

JE McGimpsey

Don't need a macro - Select your dates and choose Data/Text to Columns.
Click Next, Next, then choose yymmdd from the Date dropdown. Click
Finish. Format the dates as desired.
 
E

Ed from AZ

That worked great!!

Thanks!!
Ed


Don't need a macro - Select your dates and choose Data/Text to Columns.
Click Next, Next, then choose yymmdd from the Date dropdown. Click
Finish. Format the dates as desired.






- Show quoted text -
 
Top