Adding Space between number and converting the field into Date/Time

justujoo

New Member
Joined
Mar 4, 2016
Messages
4
Hello Guys

I've tried and tried ... Searched and searched but couldn't find a solution.. So asking here to the experts...

[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]2016-02-2413:40:31[/TD]
[TD="align: center"]2/24/16 1:40 PM[/TD]
[/TR]
[TR]
[TD="align: center"]2016-02-2413:36:05[/TD]
[TD][TABLE="width: 135"]
<tbody>[TR]
[TD="align: center"]2/24/16 1:36 PM[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD="align: center"]2016-02-2413:40:08[/TD]
[TD="align: center"]2/24/16 1:40 PM[/TD]
[/TR]
[TR]
[TD="align: center"]2016-02-2413:40:09[/TD]
[TD="align: center"]2/24/16 1:40 PM[/TD]
[/TR]
</tbody>[/TABLE]

So I need covert A into B, where A is Plain String and when I put a space after 10th character (after -24) it automatically converts into Date/Time Format and thats what I want but enter space in more than 10K records manually is not practically possible so I need some auto process, some formula....

Please help me guys

Regards
KH
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I might have over killed here but try this:
=DATE(YEAR(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),MONTH(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),DAY(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")))+TIME(HOUR(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),MINUTE(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),SECOND(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")))
 
Upvote 0
I might have over killed here but try this:
=DATE(YEAR(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),MONTH(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),DAY(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")))+TIME(HOUR(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),MINUTE(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")),SECOND(SUBSTITUTE(LEFT(A1,10)&" "&RIGHT(A1,8),"-","/")))


It Worked.....

Thank you Max
 
Upvote 0
Hi,

Would these shorter formulas also work?


Excel 2010
ABCDE
12016-02-2413:40:312/24/2016 13:402/24/2016 13:402/24/2016 13:40
22016-02-2413:36:052/24/2016 13:362/24/2016 13:362/24/2016 13:36
32016-02-2413:40:082/24/2016 13:402/24/2016 13:402/24/2016 13:40
42016-02-2413:40:092/24/2016 13:402/24/2016 13:402/24/2016 13:40
Sheet1
Cell Formulas
RangeFormula
D1=TEXT(LEFT(A1,SEARCH(":",A1)-3)&" "&RIGHT(A1,SEARCH(":",A1)-5),"m/dd/yyyy hh:mm")
E1=TEXT(LEFT(A1,10)&" "&RIGHT(A1,8),"m/dd/yyyy hh:mm")


D1 or E1 formula copied down.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top