Extracting dates in any format from text cells while containing other numbers

otown2221

New Member
Joined
Jul 16, 2020
Messages
5
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hello Guys,

Im trying to extract some dates in any format (ex: 20Jun2020, 20Nov19, 1/31/2019, etc.) I managed to extract some by using

=MID(A1,MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789",1)),LEN(A1)+1)),LOOKUP(1,0*MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),ROW(INDIRECT("1:"&LEN(A1)))) + 1 - MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789",1)),LEN(A1)+1)))

However some come out like this (see below) any way to more efficient extract the dates in any format even though other numbers are in the entry? Thank you guys in advance
2/Ref 4/10MAY2018
012 Configuration Form 6/5/2017
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Since we do not know what your text could look like, you are going to have to tell us what your various dates could look like. For example, some people use dashes or dots instead of slashes, but if your data could have dots or dashes between numbers, then we need to know their possible structure so we can decide how to tell them apart from dates using dots or dashes. I'm sure there are other possible delimiters or date orderings, so we need to know what your possible dates could look like.
 
Upvote 0
Hi and welcome to MrExcel.

2/Ref 4/10MAY2018
012 Configuration Form 6/5/2017

It would only be those 2 "types" of dates or they could be many more. You will have a larger sample of examples.
 
Upvote 0
Since we do not know what your text could look like, you are going to have to tell us what your various dates could look like. For example, some people use dashes or dots instead of slashes, but if your data could have dots or dashes between numbers, then we need to know their possible structure so we can decide how to tell them apart from dates using dots or dashes. I'm sure there are other possible delimiters or date orderings, so we need to know what your possible dates could look like.

The original text data in which I am extracting has various entries that have slashes/dashes independent of the date within it. As far as possible dates they are in various formats as well such as "MM/DD/YYYY, MM/DD/YY, DD-Mon-YYYY, DD-Mon-YY,"

Example of original text entries
CVV 4.0/ 11Jan2021
CVV 3.0/ 04MAY17
CVV 2.0/ 22Feb2011
BGS-005 v3 SCG 01/20/2020
BGS-007 v2 SCG 05-02-20

I apologize if this is a hodgepodge of mess cause it is :(
 
Upvote 0
Also I dont need every entry to be perfect just as long as I can extract a majority then I am okay with it!
 
Upvote 0
Then something like

=TRIM(RIGHT(SUBSTITUTE(I2," ",REPT(" ",99)),99))
1st col to right

or add in Datevalue
=DATEVALUE(TRIM(RIGHT(SUBSTITUTE(I2," ",REPT(" ",99)),99)))
2nd col to right
Datevalue doesn't like the mm/dd scenario

1594917093968.png
 
Upvote 0
Then something like

=TRIM(RIGHT(SUBSTITUTE(I2," ",REPT(" ",99)),99))
1st col to right

or add in Datevalue
=DATEVALUE(TRIM(RIGHT(SUBSTITUTE(I2," ",REPT(" ",99)),99)))
2nd col to right
Datevalue doesn't like the mm/dd scenario

View attachment 18374
Thank YOU SO MUCH the first formula you gave me works!

Cheers!
 
Upvote 0

Forum statistics

Threads
1,224,530
Messages
6,179,373
Members
452,907
Latest member
Roland Deschain

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