ChathurawinD
ChathurawinD

Reputation: 784

Convert date column

I have data in an excel sheet. There I have a column with date values like this.

13 May 2012

27 August 2012

21 June 2012

18 March 2012

16 November 2011

15 December 2011

Is there a way to convert it to a format like this? 1998-12-25

Upvotes: 0

Views: 29

Answers (1)

I am assuming your dates are stored as strings. If one of your data is in cell A1, use in B1

=DATEVALUE(LEFT(A1,FIND(" ",A1)-1)&" "&LEFT(MID(A1,FIND(" ",A1)+1,FIND(" ",RIGHT(A1,LEN(A1)-FIND(" ",A1)))-1),3)&" "&RIGHT(A1,4))

Then format B1 as Custom, Type: yyyy-mm-dd.

Shorter formulas are possible, in particular if you can assume that the day will always have two digits (e.g., 01, and never 1).

If your data are stored as numeric instead of string, then simply apply the formatting procedure described.

Upvotes: 1

Related Questions