Extract Date & Time Separately

dunmore83

Well-known Member
Joined
Aug 24, 2011
Messages
540
Hi,

In column A I have the following;

2021-05-07 11:31:37 +0800

I need a formula in column B to extract the date only & in column C I need a formula to extract the time only.

Any helpers out there ??

Many thanks!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi !​
Cell B formula : =DATEVALUE(LEFT(A1,10))
Cell C formula : =TIMEVALUE(MID(A1,12,8))
Format cells in each columns …​
 
Upvote 0
Thanks that works

Could you also provide a formula I can put in column D which just returns the D/M (i.e. 7/5) & the time to the nearest 15 minutes ?

So for the example above it would be 7/5 11:30pm in column D
 
Upvote 0
D/M ok but for the nearest time I have no idea for the moment but I'm sure someone else will help you …​
 
Upvote 0
format to your preferences

Date and Time 2021.xlsm
ABC
12021-05-07 11:31:37 +08007-May-2111:31:37
2custom format d"/"m7/5
3custom format hh:mm11:30
4
52021-05-07 21:41:37 +08007/509:45 PM
6
10c
Cell Formulas
RangeFormula
C1C1=--MID(A1,12,8)
B1,B5B1=--LEFT(A1,10)
B2B2=B1
C3C3=MROUND(C1,"0:15")
C5C5=MROUND(--MID(A5,12,8),"0:15")
 
Last edited:
Upvote 0
Thanks

Is it possible to refence the cell with this data 2021-05-07 11:31:37 +0800 & return "7/5 11:30" in 1 cell ?
 
Upvote 0
What did you try?

=MROUND(--LEFT(A1,19),"0:15") custom format as mentioned previously
 
Upvote 0
Thanks for your reply

When entering that formula =MROUND(--LEFT(A1,19),"0:15") it just seems to return the time which is 12:15:00 AM

Can I get it to return the date & time like "7/5 12:15" in 1 cell ?
 
Upvote 0
Did you apply the custom format d"/"m hh:mm AM/PM to that cell?

Date and Time 2021.xlsm
AB
12021-05-07 11:31:37 +08007/5 11:30 AM
10c
Cell Formulas
RangeFormula
B1B1=MROUND(--LEFT(A1,19),"0:15")
 
Upvote 0
Thanks.

Working now. I wasn't custom formatting the cell correctly. Your custom format works.... d"/"m hh:mm AM/PM

Thanks again !
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

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