View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
ward376 ward376 is offline
external usenet poster
 
Posts: 360
Default change date from 020315 to 03/15/02

If the date format from your database is cyymmdd, here is the formula
to convert it to a value that Excel will recognize as the equivalent
date:

=IF(LEN(A1)=7,VALUE(CONCATENATE(MID(A1,4,2),"/",RIGHT(A1,2),"/",MID(A1,2,2))),VALUE(CONCATENATE(MID(A1,3,2), "/",RIGHT(A1,2),"/",LEFT(A1,2))))

The formula also takes into account whether the date format prior to
2000 was mmddyy and converts to date serial.

You can format the date serial in any way you want.

Cliff Edwards