Date Formula From Text in Alternate Cell

ladylissa21

New Member
Joined
Feb 23, 2015
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hello smart people! :)

I'm using a formula currently to extract the date out of a text comment, and it's been working well until we hit the double digit months. It enters the single digit months perfectly, as (for example) 09/13/2018. But in the double digit months, it's giving me (for example, in October) 0/23/2018. It's not recognizing that first digit.

So currently L2 has a text comment that reads something like: SERVICING NOTE REVIEW COMPLETED ON 10/24/2018.

And the existing formula in M2 is: =MID(L2,MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},L2,1),LEN(L2)+1)),LOOKUP(1,0/MID(L2,ROW(INDIRECT("1:"&LEN(L2))),1),ROW(INDIRECT("1:"&LEN(L2)))) + 1 - MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},L2,1),LEN(L2)+1)))

I found that formula online and have no idea how to alter it to fix the issue. I want it, ideally, to populate the date as given in the note, and ignore any empty fields in L2. Thank you!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi,

If your dates within the Text string is Always in the format mm/dd/yyyy

Formula will extract the Date if exist; otherwise, results in Blank:


Book1
LM
2SERVICING NOTE REVIEW COMPLETED ON 10/24/201810/24/2018
3
4SERVICING NOTE REVIEW HAS NOT BEEN COMPLETED
5SERVICING NOTE REVIEW COMPLETED ON 09/13/201809/13/2018
Sheet350
Cell Formulas
RangeFormula
M2=IFERROR(MID(L2,SEARCH("??/??/????",L2),10),"")
 
Last edited:
Upvote 0
That takes care of a lot of it, thank you! Is there any way to account for other date formats in the formula, such as M/D/YY or MM/D/YY?
 
Upvote 0
Will there be Other numbers besides the Date within the text string?

Please show a Few sample of possible text strings.
 
Upvote 0
No, there shouldn't be any other numbers. Some additional examples of the text strings are: SERVCING NOTE REVIEW 5/25/18, SERVICING NOTE REVIEW 11/7/2018, or SERVICING NOTE REVIEW 1/1/19. I'm really just asking if there's a way for the formula to account for variations in the date formats; if not, I've still got good old Find and Replace!
 
Upvote 0
Are the Dates Always at the End of the Text string?

Edit: ALSO, do you need the Result converted to Real Date Values in case for further comparison/math?
 
Last edited:
Upvote 0
If the answers to my questions above are YES, NO, respectively, use M2 formula.
If the answers are NO, YES, respectively, use N2 formula and Format result Cell/Column as Date:


Book1
LMN
2SERVICING NOTE REVIEW COMPLETED ON 10/24/201810/24/201810/24/2018
3
4SERVICING NOTE REVIEW HAS NOT BEEN COMPLETED
5SERVICING NOTE REVIEW COMPLETED ON 09/13/201809/13/20189/13/2018
6SERVCING NOTE REVIEW 5/25/185/25/185/25/2018
7SERVICING NOTE REVIEW 11/7/201811/7/201811/7/2018
8SERVICING NOTE REVIEW 1/1/191/1/191/1/2019
9SERVICING NOTE REVIEW ON 09/13/2018 COMPLETED9/13/2018
10
11Format Result
12Column/Cell as Date
Sheet350
Cell Formulas
RangeFormula
M2=MID(L2,MIN(FIND({0,1,2,3,4}+{0;5},L2&1/17)),99)
N2=IFERROR(LEFT(SUBSTITUTE(MID(L2,MIN(FIND({0,1,2,3,4}+{0;5},L2&1/17)),99)," ",REPT(" ",99)),99)+0,"")
 
Upvote 0
Thank you so much for your help, @jtakw! I'm having a new issue with this same data due to a system change. Now, when the data comes in (same as in your example table above), it often includes a series of underscores at the end, that the system uses to complete the line. The N formula is what I was using, successfully - is there any way to adapt it to this[TABLE="class: grid, width: 600, align: left"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]
LATE CHARGE NOTE REVIEW COMPLETED ON 08/28/2018___________________
<strike></strike>[/TD]
[TD]<strike></strike>[/TD]
[/TR]
[TR]
[TD]
LATE CHARGE NOTE REVIEW COMPLETED ON 09/17/2018___________________
<strike></strike>[/TD]
[TD]<strike></strike>[/TD]
[/TR]
[TR]
[TD]
LATE CHARGE NOTE REVIEW COMPLETED ON 10/16/2018___________________
<strike></strike>[/TD]
[TD]<strike></strike>[/TD]
[/TR]
[TR]
[TD]
_LATE CHARGE NOTE REVIEW COMPLETED ON 09/12/2018
<strike></strike>[/TD]
[TD]
9/12/2018
[/TD]
[/TR]
[TR]
[TD]
_LATE CHARGE NOTE REVIEW COMPLETED ON 10/29/2018
<strike></strike>[/TD]
[TD]
10/29/2018
[/TD]
[/TR]
</tbody>[/TABLE]
new data?
 
Last edited:
Upvote 0
Modified for your current need:


Book1
AB
1LATE CHARGE NOTE REVIEW COMPLETED ON 08/28/2018___________________8/28/2018
2LATE CHARGE NOTE REVIEW COMPLETED ON 09/17/2018___________________9/17/2018
3LATE CHARGE NOTE REVIEW COMPLETED ON 10/16/2018___________________10/16/2018
4_LATE CHARGE NOTE REVIEW COMPLETED ON 09/12/20189/12/2018
5_LATE CHARGE NOTE REVIEW COMPLETED ON 10/29/201810/29/2018
6SERVICING NOTE REVIEW COMPLETED ON 10/24/201810/24/2018
7SERVICING NOTE REVIEW HAS NOT BEEN COMPLETED
8SERVICING NOTE REVIEW COMPLETED ON 09/13/20189/13/2018
9SERVCING NOTE REVIEW 5/25/185/25/2018
10SERVICING NOTE REVIEW 11/7/201811/7/2018
11SERVICING NOTE REVIEW 1/1/191/1/2019
12SERVICING NOTE REVIEW ON 09/13/2018 COMPLETED9/13/2018
Sheet350
Cell Formulas
RangeFormula
B1=IFERROR(SUBSTITUTE(LEFT(SUBSTITUTE(MID(A1,MIN(FIND({0,1,2,3,4}+{0;5},A1&1/17)),99)," ",REPT(" ",99)),99),"_","")+0,"")
 
Upvote 0
That works perfectly, thank you! The only ones not pulling over now are the ones with dates that are really formatted incorrectly, like a five-digit year or something - which works, because I want to correct those for my final results. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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