Text to Date.

countryfan_nt

Well-known Member
Joined
May 19, 2004
Messages
668
Hello friends, hope all is well!

the cell A1 has this: 9/18/2018 12:00:00 AM

the Cell is not recognized as a date. Can you please help provide me with a formula that will convert this to date i.e. 18-Sep-2018 ?


Thank you very much in advance!
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,348
Here a UDF which can help you
Somewhere put =MyDate(A1)
Code:
Option Explicit


Function MyDate(ByVal WkRg As Range) As Date
Dim T
    T = Trim(Left(WkRg, 10))
    T = Split(T, "/")
    MyDate = DateSerial(T(2), T(0), T(1))
End Function
 

Forum statistics

Threads
1,085,651
Messages
5,384,936
Members
401,927
Latest member
commae

Some videos you may like

This Week's Hot Topics

Top