Extract dates and times from text string

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
119
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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