Date format

  • Thread starter Thread starter Katerinia
  • Start date Start date
K

Katerinia

Text in Column E is a date mddyyyy
I need to calculate the age but the text format of this date is throwing off
the number. Any suggestions

8241938
4121939
8071965
2251950
2101940
12201964
1241980
5311961
3281982
3021967
9171961
10211977
 
To calculate the age with data as such ...try

=DATEDIF(DATE(RIGHT(TEXT(A1,"00000000"),4),
LEFT(TEXT(A1,"00000000"),2),MID(TEXT(A1,"00000000"),3,2)),
TODAY(),"y") & " years"
 
Forgot to mention...If you want to convert that to a valid date apply the
below formula to a column near by and format to date....

=--TEXT(A1,"00\/00\/0000")
 
Assume that you are having the one of the data in A1 cell.

If your system date format is MM/DD/YYYY then copy and paste the below
formula in B1 cell

=IF(A1="","",IF(LEN(TRIM(A1))=7,VALUE(LEFT(TRIM(A1),1)&"/"&MID(TRIM(A1),2,2)&"/"&RIGHT(TRIM(A1),4)),IF(LEN(TRIM(A1))=8,VALUE(LEFT(TRIM(A1),2)&"/"&MID(TRIM(A1),3,2)&"/"&RIGHT(TRIM(A1),4)))))

If your system date format is DD/MM/YYYY then copy and paste the below
formula in B1 cell

=IF(A1="","",IF(LEN(TRIM(A1))=7,VALUE(MID(TRIM(A1),2,2)&"/"&LEFT(TRIM(A1),1)&"/"&RIGHT(TRIM(A1),4)),IF(LEN(TRIM(A1))=8,VALUE(MID(TRIM(A1),3,2)&"/"&LEFT(TRIM(A1),2)&"/"&RIGHT(TRIM(A1),4)))))
 
Back
Top