Extract date from text column and convert it to desired date format

elmer57

New Member
Joined
Jun 23, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi - I'm running Office / Excel 365 in Windows 10. I have a text column that contains dates (in different formats) surrounded by other text. The column is free-form, meaning the date is mixed into the text column with no specific pattern. I would like to find the the date in the text column and copy it to another column using a specific column format. To complicate things, the date in the text column is sometimes formatted with periods, dashes or slashes and the date character length varies. The "source" column below is an example of my text column and the "Desired / expected result" column is what I'm hoping to get. Any help would be greatly appreciated.

Xl2bb code:
Extract example.xlsx
AB
1SourceDesired / Expected result
2South 1-18-22 video other text2022-01-18
3Brick stripe building 05.18.2023 other text2023-05-18
4tree cancel lawnmower 2/23/20192019-02-23
Sheet1


Excel Post.JPG


Thank you!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
As long as those three date formats are the only variations there are, this should work...
Excel Formula:
=TEXT(MAP(A2:A4,LAMBDA(a,MAX(MAP(TEXTSPLIT(SUBSTITUTE(a,".","/")," "),LAMBDA(d,IFERROR(0+d,0)))))),"yyyy-mm-dd")
 
Upvote 1
Solution

Forum statistics

Threads
1,215,126
Messages
6,123,200
Members
449,090
Latest member
bes000

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