Sunday, 18 September 2011

Converting a non-date string to a date

Converting a non-date string to a date

You may import data that contains dates coded as text strings. For example, the following text
represents August 21, 2010 (a four-digit year followed by a two-digit month, followed by a two-
digit day):

  20100821

To convert this string to an actual date, you can use a formula such as this one, which assumes
the coded date is in cell A1:

  =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

No comments:

Post a Comment