Extract date from text

gromden

New Member
Joined
Jun 18, 2015
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I am trying to figure out how to extract a date from a text cell but not sure how to modify the formula when the date is single number (1, 2, etc) vs a two digit number (12, 13, etc) as the data I am extracting is in text format vs date format.
The date would look like:
Dec 1, 2024, 12:13:12 PM
Dec 10, 2024, 1:00:14 PM
I don't really need the time so I have been using =INT(LEFT(D186, 11) or =INT(LEFT(D186, 12) but would prefer one formula rather than having to modify it every time I paste in new data. Column D is where the date is in.

If anyone has any pointers, would be appreciated! Thanks.
 

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.
how about as you have 365
=TEXTBEFORE(D186, ",", 2)

BUT i dont see why
=INT(LEFT(D186, 11)
would work - as its TEXT

did you want to change to a real date ?
 
Last edited:
Upvote 0
Ahh I realized I don't really need INT since it is text. I did try what you suggested and it did work. Thanks for that.
If I did want to convert to a real date, what do you suggest?
 
Upvote 0
Ahh I realized I don't really need INT since it is text. I did try what you suggested and it did work. Thanks for that.
If I did want to convert to a real date, what do you suggest?
Wrapping the function in INT (like you had) or DATEVALUE will convert it to a real date.
Then just choose your desired date format for the cell.
 
Upvote 0

Forum statistics

Threads
1,225,626
Messages
6,186,089
Members
453,336
Latest member
Excelnoob223

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