Date written need to extract into date format

Arts

Well-known Member
Joined
Sep 28, 2007
Messages
775
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all

I have the below text which is generated from a report (the length of the name can vary as this can be run be a few different people)

Generated on behalf of Tom Pitt on Tuesday, January 9, 2024 9:02:31 AM

What I am hoping to do is to extract the date and get it into a format (ie 01/02/24) so I can apply a formula to let the individual know how long it has been since the report has been run. I've started backwards in that I have the formula for this part but the extraction of the date is proving difficult for me. (image attached showing desired outcome once date can be extracted from the string)

1707479914686.png



My efforts so far have I have managed to get extract "January 9 2024 9:02:31 AM" by using =TRIM(SUBSTITUTE(MID(A4,SEARCH(",",A4),40),",","")) but I think I am going down the wrong path here....

Any help as always is most appreciated.
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi, here's a less regionally specific option you can try:

Excel Formula:
=LET(PARTS,TEXTSPLIT(TEXTAFTER(A4,","),{" ",","},,1),DATE(INDEX(PARTS,3),MATCH(INDEX(PARTS,1),TEXT(DATE(1,SEQUENCE(12),1),"mmmm"),0),INDEX(PARTS,2)))
 
Upvote 0
Try this:
Excel Formula:
=LET(x,TEXTBEFORE(TRIM(TEXTAFTER(A4,","))," ",3),DATEVALUE(TEXTBEFORE(TEXTAFTER(x," "),",")&" "&TEXTBEFORE(x," ") & " " & RIGHT(x,4)))
 
Upvote 0
Solution
Both of those do the trick! If it's ok with you FormR I'll mark Joe's response as the solution as the time he spent helping me on this.

Thank you both and once again thanks Joe for all the help on this.
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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