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...

AB
2016-02-2413:40:312/24/16 1:40 PM
2016-02-2413:36:05
2/24/16 1:36 PM

<tbody>
</tbody>
2016-02-2413:40:082/24/16 1:40 PM
2016-02-2413:40:092/24/16 1:40 PM

<tbody>
</tbody>

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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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,216,151
Messages
6,129,162
Members
449,489
Latest member
spvclub

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