change date from 020315 to 03/15/02

  • Thread starter Thread starter CHARI
  • Start date Start date
Assuming you original data is formatted as Custom yymmdd, change the format to:
mm/dd/yyyy
 
Gary''s Student said:
Assuming you original data is formatted as Custom yymmdd, change the format to:
mm/dd/yyyy


No, it's not formatted that way. The original format was 1020315 and I
removed the 1 but I can't get the formatting to change. This was originally
a text file I imported. Should I import it different or can I change it as
is?
 
Try this formula instead:

=DATE(2000+LEFT(A1,2),--MID(A1,3,2),RIGHT(A1,2))
 
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
 
ward376 said:
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

PERFECT, THANK YOU!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top