Extract Date and Time

kmonkmol

Board Regular
Joined
Mar 13, 2014
Messages
50
Hello
I have a Sales Data Sheet, I need Extract my date and time in separate column from a text range. i attached my file please reply me.

Here is the link
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
what version of excel do you use?
 
Upvote 0
Your Date column contains a date value, not a text value. In this case:

Book1
BCDE
1DateEDateETime
23/31/2023 12:02:40 AM3/31/202312:02 AM
33/31/2023 12:04:51 AM3/31/202312:04 AM
43/31/2023 12:05:40 AM3/31/202312:05 AM
53/31/2023 12:08:37 AM3/31/202312:08 AM
63/31/2023 12:09:20 AM3/31/202312:09 AM
73/31/2023 12:12:33 AM3/31/202312:12 AM
83/31/2023 12:18:35 AM3/31/202312:18 AM
Sheet1
Cell Formulas
RangeFormula
D2:D8D2=DATE(YEAR(B2),MONTH(B2),DAY(B2))
E2:E8E2=TIME(HOUR(B2),MINUTE(B2),SECOND(B2))


Note: You need to format the new date and time columns accordingly.
 
Upvote 0
For 365:
mr excel questions 21.xlsm
ABCDEFGHIJKL
1Order IDDateOuletUserTerminalSKUProductQuantityUnit PriceTotalEDateETime
2312,5563/31/2023 12:02:40 AMMobile Sales 1MS1JMEIT1515035424PRODUCT-1150502023-03-3112:02:40 AM
3312,5573/31/2023 12:04:51 AMMobile Sales 1MS1JMEIT151507963PRODUCT-225102023-03-3112:04:51 AM
4312,5583/31/2023 12:05:40 AMMobile Sales 1MS1JMEIT151508985PRODUCT-3125252023-03-3112:05:40 AM
5312,5593/31/2023 12:08:37 AMMobile Sales 1MS1JMEIT151507963PRODUCT-21552023-03-3112:08:37 AM
6312,5603/31/2023 12:09:20 AMMobile Sales 1MS1JMEIT151507963PRODUCT-21552023-03-3112:09:20 AM
7312,5613/31/2023 12:12:33 AMMobile Sales 1MS1JMEIT151507963PRODUCT-225102023-03-3112:12:33 AM
kmonkmol
Cell Formulas
RangeFormula
K2:K7K2=DATE(RIGHT(TEXTBEFORE(B2," "),4),TEXTBEFORE(B2,"/"),TEXTAFTER(TEXTBEFORE(B2,"/",2),"/"))
L2:L7L2=TIMEVALUE(TEXTAFTER(B2," "))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A1317Expression=MOD(A1,1)=0textNO
H1:H1317Expression=MOD(A1,1)=0textNO
I1:I1317Expression=MOD(A1,1)=0textNO
J1:J1317Expression=MOD(A1,1)=0textNO
 
Upvote 0
Here is another option if column B are datevalues:
mr excel questions 21.xlsm
ABCDEFGHIJKL
8312,56203/31/2023 12:18:35 AMMobile Sales 1MS1JMEIT151507963PRODUCT-4125252023-03-3112:18:35 AM
9312,56303/31/2023 12:20:29 AMMobile Sales 1MS1JMEIT151500351PRODUCT-5125252023-03-3112:20:29 AM
10312,56403/31/2023 12:21:18 AMMobile Sales 1MS1JMEIT151508985PRODUCT-6195952023-03-3112:21:18 AM
11312,56503/31/2023 12:26:06 AMMobile Sales 1MS1JMEIT1515038192PRODUCT-7125252023-03-3112:26:06 AM
12312,56603/31/2023 12:33:36 AMMobile Sales 1MS1JMEIT1515028431PRODUCT-8115152023-03-3112:33:36 AM
13312,56703/31/2023 12:37:12 AMMobile Sales 1MS1JMEIT1515019351PRODUCT-9130302023-03-3112:37:12 AM
14312,56803/31/2023 12:40:00 AMMobile Sales 1MS1JMEIT151507963PRODUCT-4125252023-03-3112:40:00 AM
kmonkmol
Cell Formulas
RangeFormula
K8:K14K8=INT(B8)
L8:L14L8=MOD(B8,1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A1317Expression=MOD(A1,1)=0textNO
H1:H1317Expression=MOD(A1,1)=0textNO
I1:I1317Expression=MOD(A1,1)=0textNO
J1:J1317Expression=MOD(A1,1)=0textNO
 
Upvote 0
@kmonkmoi which post solution is getting the #VALUE Error.
It is IMPORTANT to know what version of excel you are using.
 
Upvote 0
Post #5 will work for your if COLUMN B are DATE/TIME Values.
 
Upvote 0
getting Value error "#VALUE!


Here is another option if column B are datevalues:
mr excel questions 21.xlsm
ABCDEFGHIJKL
8312,56203/31/2023 12:18:35 AMMobile Sales 1MS1JMEIT151507963PRODUCT-4125252023-03-3112:18:35 AM
9312,56303/31/2023 12:20:29 AMMobile Sales 1MS1JMEIT151500351PRODUCT-5125252023-03-3112:20:29 AM
10312,56403/31/2023 12:21:18 AMMobile Sales 1MS1JMEIT151508985PRODUCT-6195952023-03-3112:21:18 AM
11312,56503/31/2023 12:26:06 AMMobile Sales 1MS1JMEIT1515038192PRODUCT-7125252023-03-3112:26:06 AM
12312,56603/31/2023 12:33:36 AMMobile Sales 1MS1JMEIT1515028431PRODUCT-8115152023-03-3112:33:36 AM
13312,56703/31/2023 12:37:12 AMMobile Sales 1MS1JMEIT1515019351PRODUCT-9130302023-03-3112:37:12 AM
14312,56803/31/2023 12:40:00 AMMobile Sales 1MS1JMEIT151507963PRODUCT-4125252023-03-3112:40:00 AM
kmonkmol
Cell Formulas
RangeFormula
K8:K14K8=INT(B8)
L8:L14L8=MOD(B8,1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A1317Expression=MOD(A1,1)=0textNO
H1:H1317Expression=MOD(A1,1)=0textNO
I1:I1317Expression=MOD(A1,1)=0textNO
J1:J1317Expression=MOD(A1,1)=0textNO
Value Error
 
Upvote 0

Forum statistics

Threads
1,215,564
Messages
6,125,581
Members
449,237
Latest member
Chase S

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