Note: The other languages of the website are Google-translated. Back to English

How to extract date from text strings in Excel?

In Excel worksheet, how could you extract the date from text strings as following screenshot shown? This article, I will talk about a useful formula to solve it.

Extract date from text strings with array formula in worksheet


Extract date from text strings with array formula in worksheet

To extract only date from a list of text strings, the following array formula can help you, please do as this:

1. Enter the below formula into a blank cell where you want to get the result, and then press Enter keys together, and only the date is extracted as following screenshot shown:

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

2. Then select the formula cell, and drag the fill handle down to the cells you want to apply this formula, and you will get the results as you need, see screenshot:

  • Notes:
  • In the above formula, A2 is the cell which contains the date you want to extract;
  • If the cell contains other numbers, this formula will not work correctly;
  • The formula cannot correctly extract date while there is more than one date in the text string.

Convert various non-standard dates to normal real date in Excel

With the Convert to Date utility of Kutools for Excel, you can quickly convert various non-standard dates to normal real dates at the same time in Excel. Click to download Kutools for Excel!

Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Download and free trial Now!


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (23)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Can someone help me find a string to extract the date in this format please yyyy-mm-dd
"2018-03-24T01:42:26-07:00"



Thanks much in advance
This comment was minimized by the moderator on the site
PLEASE HELP ME EXTRACT DATE FROM THE STATEMENTS LIKE "PLEASE DELIVER BY Fri,01 January ,2016"
This comment was minimized by the moderator on the site
I'm using Excel 2003, so I believe the IFERROR does not exist, and I found this quoted on the web to be the equivalent:

IFERROR(A1,"") = IF(ISERROR(A1),"")

So I'm trying this:

=MID(A2,MIN(IF(ISERROR(FIND({0,1,2,3,4,5,6,7,8,9},A2,1)),LEN(A2)+1)),LOOKUP(1,0/MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),ROW(INDIRECT("1:"&LEN(A2)))) + 1 - MIN(IF(ISERROR(FIND({0,1,2,3,4,5,6,7,8,9},A2,1)),LEN(A2)+1)))


- I did press CTRL+SHIFT+ENTER the actual formula in excel shows it in {}

Using this formula, I just get a blank result

Can check and let me know where I’ve gone wrong... Or is it not possible in Excel 2003

Thank you
This comment was minimized by the moderator on the site
Actually my data to extract is in the format:

Data valid for 14 December 2018

So I need to extract the "14 December 2018" and not the usual
xx/xx/xx
This comment was minimized by the moderator on the site
This seemsto for work me(Excel 2003)

=DATEVALUE(MID(A2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")),17))

: A2 contains the data to extract

: it finds the first numerical value, then translates restas date

Works for data in this format : Data valid for 14 December 2018
This comment was minimized by the moderator on the site
Hi Tak,
Its working perfectly. But why "17" at the end? kindly assist.
This comment was minimized by the moderator on the site
Looking at the "mid" function" it's = number of characters...

So the longest it will be = "dd september yyyy" = 17 characters

2 = date
9 = month
4 = year
2 = spaces

Maybe I should have said the data is : "25 September 2018"

So 17 should cover for all the months of the year :)
This comment was minimized by the moderator on the site
how about if my text is "Date and time of submission: September 16, 2018 at 11:26:00 PM PDT"? What kind of formula can i use ?
This comment was minimized by the moderator on the site
Hi, Help me please! How about if my text is "Date and time of submission:23-Jun-2017 12:34:58 AM PDT. What kind of formula can i use ?
This comment was minimized by the moderator on the site
This was working perfectly up until 01/01/2020 - Anyone know how to fix this?
This comment was minimized by the moderator on the site
Hello, Adam,
The formula has been fixed as below:
=MID(A2,MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)),LOOKUP(1,0*MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),ROW(INDIRECT("1:"&LEN(A2)))) + 1 - MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)))


Please try, hope it can help you!
This comment was minimized by the moderator on the site
Hello, I tried it with a string and it doesn't work
This comment was minimized by the moderator on the site
skyyang - Sorry I've moved away onto something else. This works perfectly - Thank you so much!
This comment was minimized by the moderator on the site
I'm experiencing a problem with this formula not displaying the entire date value.
Similar to Adam Tabor, the formula was displaying the date value as expected up until 01/01/2020. Since then, the date value is missing the last digit

Example:
Cell A1 contains the string "Monthly-Returned-Ticket-Report-01-29-2020"

Cell A2 contains the following formula:
=MID(A1,MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A1,1),LEN(A1)+1)),LOOKUP(1,0/MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),ROW(INDIRECT("1:"&LEN(A1)))) + 1 - MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A1,1),LEN(A1)+1)))

Expected Result: Cell A2 displays the value "01-29-2020"

Actual Result: Cell A2 displays the value "01-29-202"

Hoping someone has an idea about what needs to be tweaked to deal with this new behavior since the new year?
This comment was minimized by the moderator on the site
Hello, Neil,
The formula in this article has been updated, please apply the below formula:
=MID(A2,MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)),LOOKUP(1,0*MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),ROW(INDIRECT("1:"&LEN(A2)))) + 1 - MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)))


Please try, hope it can help you!
This comment was minimized by the moderator on the site
This updated formula worked for my use case when I changed my source cell to A2. Thanks for the update Skkyang! :)
This comment was minimized by the moderator on the site
skyyang - Sorry I've moved away onto something else. This works perfectly - Thank you so much!
This comment was minimized by the moderator on the site
I'm aware that the formula wont work if there are other numbers in the cell, however, is there a way to only extract numbers that are in date format?
Example: People 5/ 2/12/20
Ignore the 5 and only output the 2/12/2020

Thank you
This comment was minimized by the moderator on the site
Hello!
How can I extract date from the text "Wed Jul 01 2020 04:20:05 GMT+0000 (Coordinated Universal Time)" in mm/dd/YYYY format using a formula?
Can someone please help me.
This comment was minimized by the moderator on the site
Hi, Admin.
i am unable to extract date from below text.
RETURNED_INCOMPLETE -> INCOMPLETE JSV appointment confirmed 15/10/2020, PM. Without WFM sub after 5pm
upon entering the given formula values are coming. 15/10/2020, PM. Without WFM sub after 5

"RETURNED_INCOMPLETE -> INCOMPLETE JSV-Appointment confirmed on -21/10/2020 PM mhumza wanted 06 to 07 PM coz working"upon entering the given formula values are coming. 21/10/2020 PM mhumza wanted 06 to 07

"RETURNED_INCOMPLETE -> INCOMPLETE JSV-Appointment confirmed on 18/10/2020 PM mhumza wanted at 16:30 to 18:00 pm"upon entering the given formula values are coming. 18/10/2020 PM mhumza wanted at 16:30 to 18:00

RETURNED_INCOMPLETE -> INCOMPLETE JSV appointment confirmed 15/10/2020, AM. Without WFM sub is available only until 9am
upon entering the given formula values are coming. 15/10/2020, AM. Without WFM sub is available only until 9


please support and help.
This comment was minimized by the moderator on the site
HI, how can I extract the date from this string
BRIGHT PINK - PK0040 9/1/2020 5:27:55AM 1
This comment was minimized by the moderator on the site
=MID(A26,FIND("/",A26)-2,10)

Hey Jorge,

your query is simple and you can get the answer with this formula and also you can get the answer with Flash Fill.
This comment was minimized by the moderator on the site
Hi Usman,

=IFERROR(MID(A29,FIND("/",A29)-2,10),"")

please use this formula, it's very simple and easy to edit. you can edit this formula as per your query.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations