Forum Discussion

excelnewbie99's avatar
excelnewbie99
Copper Contributor
Jan 08, 2023
Solved

Transform text string into date-time

Hello,   Can someone help me how to transform the following text string into a proper date-time format in Excel?   20180709-150633   Thanks a lot!   Marc  
  • OliverScheurich's avatar
    Jan 08, 2023

    excelnewbie99 

    =DATE(LEFT(LEFT(B3,SEARCH("-",B3)-1),4),MID(LEFT(B3,SEARCH("-",B3)-1),5,2),RIGHT(LEFT(B3,SEARCH("-",B3)-1),2))+TIME(MID(B3,10,2),MID(B3,12,2),MID(B3,14,2))

     

    You can try this formula with the user defined format highlighted in the screenshot.

     

Resources