Welcome to the real world, this is how it is most of the time. If you are talking about dates such 20011231, you have to parse it and turn it into a date! There would be lots of ways to do this, in Excel you could use:
CRSP dates: 19800522 (Say this is E62)
text formula: 05/22/80 (F62)
datenum: 05/22/80 (G62)
E62: 19800522
F62: =MID(TEXT(E62,0), 5, 2)&"/"&RIGHT(TEXT(E62,0),2)&"/"&RIGHT(LEFT(TEXT(E62,0),4),2)
G62: =VALUE(F62)
You could just make a single formula:
=value(MID(TEXT(E62,0), 5, 2)&"/"&RIGHT(TEXT(E62,0),2)&"/"&RIGHT(LEFT(TEXT(E62,0),4),2))
You might start maintaining a spreadsheet of these sort of utilities since they will continue to arise. This is true whether you go into business or academia.
Previous | Back to STAT 482/682 Assignments FAQ | Next |