Bob
Bob

Reputation: 885

convert text to dd/mm/yyyy format

How do I convert the following text into dd/mm/yyyy format, in excel:-

24032006 
 2042005
19012008
 2092001

The expected results should be:-

24/03/2006
02/04/2005
19/01/2008
02/09/2001

Thanks

Upvotes: 1

Views: 5149

Answers (2)

Sachin Shanbhag
Sachin Shanbhag

Reputation: 55489

NEW ANSWER Try this formula -

=TEXT(DATE(MOD(A1,10^4),MOD(INT(A1/10^4),10^2),INT(A1/10^6)),"dd/mm/yyyy")

Assuming the text "20122010" in date format is in cell A1

OLD ANSWER

Assuming you will use some coding language to get this done, You can first check the length of string is 8. If its 7, then add 0 to front of string to make it 8. Then you can just insert '/' after two characters and get the string in dd/MM/yyyy format.

Upvotes: 2

user448374
user448374

Reputation:

'mm' represents minutes, your format should be 'dd/MM/yyyy'

Upvotes: 0

Related Questions