Here's one approach:
- Substitute dots with slashes
- Use
DATEVALUE
, TIMEVALUE
functions on relevant subsections of this substituted string. Subsections are fetched using LEFT
and RIGHT
string functions.
- These return a serial number for dates (days since 1900) and time (a floating point between 0 and 1). When summed, the value can be represented as both date and time, in a format of your choice, as shown below:
Or, showing formulas:
EDIT: adding all-in-one formula.
Note that this will give you the serial value (41934.5652777778), which can then be formated using the built in formats for dates / times--just select the one you want. This does not actually render a string:
=DATEVALUE(LEFT(SUBSTITUTE(A1,".","/"),10))+TIMEVALUE(RIGHT(SUBSTITUTE(A1,".","/"),8))
If, however, you do want a string returned, you can use the TEXT
function.
=TEXT(DATEVALUE(LEFT(SUBSTITUTE(A1,".","/"),10))+TIMEVALUE(RIGHT(SUBSTITUTE(A1,".","/"),8)),"m/d/yyyy h:mm AM/PM")
(This is done in libreoffice, but the same formulas and arguments exist in MS Excel)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…