Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Date Conversion Formula 3

Status
Not open for further replies.

RonCT

Technical User
Dec 11, 2003
37
0
0
US
Can someone tell me the formula to convert this date 20040331 to 03/31/2004? Thanks!
 
Assuming that all dates contain 8 characters,
Code:
=(LEFT(RIGHT(A1,4),2) & "/" & RIGHT(A1,2) & "/" & LEFT(A1,4))*1
Then format the cell any way you wish, E.g. Format>Cells then choose Custom and type in MM/DD/YYYY.

Hope that helps!
John
 
Not sure if you are looking for a VB solution but if not:

Use Text to columns using fixed

Then rebuild using concatenate and include a cell with / in it


Regards

Keith
 
The above will work but I'll also provide a way to put it in just "date" format.

Assuming the data is in A1...

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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top