Text Date to Value Date

Recently I was going through a set of data in excel which had dates in dd.mm.yy format e.g. 03.06.12
The dates did not allow to do any calculation on them as they were imported as text format.
Doing find and replace “.” With “/” with Ctrl+H command didn’t help as it changes the date format to mm.dd.yy with dates as months and vice versa, in some cases dates greater than 12 produced error.

I used the formula
=DATE(RIGHT(A1,2)+100,MID(A1,4,2),LEFT(A1,2))

RIGHT(),MID() and LEFT() extracts the dates year, month and date value
100 is added to RIGHT() as year belong to 2000’s

DATE() put them in order

Now I was able to format and do calculations on dates

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s