ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   convert text to date (https://www.excelbanter.com/excel-discussion-misc-queries/201733-convert-text-date.html)

Samuel

convert text to date
 
I have a text column 02/21/08 2315

I want to convert this to an actual date/time column keeping in military
format.

Niek Otten

convert text to date
 
=DATEVALUE(LEFT(A1,FIND(" ",A1)))+TIMEVALUE(LEFT(RIGHT(A1,LEN(A1)-FIND(" ",A1)),2)&":"&RIGHT(RIGHT(A1,LEN(A1)-FIND(" ",A1)),2))

Format Custom as mm/dd/yy hhmm

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"samuel" wrote in message ...
|I have a text column 02/21/08 2315
|
| I want to convert this to an actual date/time column keeping in military
| format.



Rick Rothstein

convert text to date
 
Put this formula in an unused column starting in the same row as your
topmost "text date"...

=--(LEFT(A1,11)&":"&RIGHT(A1,2))

adjusting the two A1 references to your topmost "text date" cell address,
then copy the formula down. While those cells are still selected, press
Ctrl+C, then click in your topmost "text date" cell and click
Edit/PasteSpecial from Excel's menu bar, select the Value option from the
Paste section and click the OK button. Press Esc to clear the copy
selection, select the row you just pasted over (the one that had your "text
dates" in it originally), and Custom Format the Cells with this...

mm/dd/yy hhmm

You will now have real dates that are formatted to look like the original
"text dates".

--
Rick (MVP - Excel)


"samuel" wrote in message
...
I have a text column 02/21/08 2315

I want to convert this to an actual date/time column keeping in military
format.




All times are GMT +1. The time now is 04:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com