Extract dates and times from text string

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
112
Office Version
  1. 365
Platform
  1. Windows
Hi Brains Trust,

I'm looking for a formula/s to extract date, date & time from a text string in cell A1.

string in A1 is: ceSHIFT 19/12/2022 8:30 AM-19/12/2022 5:00 PM

so... in B1 it would show 19/12/2022 and in C1 it would show 19/12/2022 8:30 AM and in cell D1 it will show 19/12/2022 5:00 PM

I'm unable to load into the forum with XL2BB due to security restriction in place on my work PC...
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try this:

Dante Amor
ABCD
1string in A1 is: ceSHIFT 19/12/2022 8:30 AM-19/12/2022 5:00 PM19/12/202219/12/2022 8:30 AM19/12/2022 5:00 PM
Hoja3
Cell Formulas
RangeFormula
B1B1=MID(A1,SEARCH("??/??/",A1),10)
C1C1=MID(A1,SEARCH("??/??/",A1),SEARCH("-",A1)-SEARCH("??/??/",A1))
D1D1=TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",99)),99))
 
Upvote 0
Solution
Try this:

Dante Amor
ABCD
1string in A1 is: ceSHIFT 19/12/2022 8:30 AM-19/12/2022 5:00 PM19/12/202219/12/2022 8:30 AM19/12/2022 5:00 PM
Hoja3
Cell Formulas
RangeFormula
B1B1=MID(A1,SEARCH("??/??/",A1),10)
C1C1=MID(A1,SEARCH("??/??/",A1),SEARCH("-",A1)-SEARCH("??/??/",A1))
D1D1=TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",99)),99))
worked brilliantly - cheers!!! have a great Xmas!
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,559
Members
448,970
Latest member
kennimack

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