how to convert a column of numbers (monthdayyear) into dates?

W

wsucougar

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.
 
C

CLR

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3,2)),IF(LEN(A1)=7,DATE(RIGHT(A1,4),LEFT(A1,1),MID(A1,2,2))))

Vaya con Dios,
Chuck, CABGx3
 
M

Marcelo

Hi,

try it

=if(len(b2)=7,date(right(b2,4),left(b2,1),mid(b2,2,2)),date(right(b2,4),left(b2,2),mid(b2,3,2)))

hth
regards from Brazil
Marcelo

"wsucougar" escreveu:
 
R

Ron Rosenfeld

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.

Here's one method:

=DATE(MOD(A1,10^4),INT(A1/10^6),MOD(INT(A1/10^4),100))


--ron
 
C

CLR

Sorry, forgot the final case of the cell being anything other than containing
7 or 8 characters...........

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3,2)),IF(LEN(A1)=7,DATE(RIGHT(A1,4),LEFT(A1,1),MID(A1,2,2)),""))

Vaya con Dios,
Chuck, CABGx3
 
Top