Text tring to date

jag108

Active Member
Joined
May 14, 2002
Messages
433
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hi

I need to convert this text string into a standard date fromat.

each cell is formatted like "4 Mar 2007 Su" I need it to be 20070304

I have managed to seperate out the different parts i.e.

04 = day_val
"Mar" = month_val
2007 = year_val

But I am having the most difficult time getting them back to the date format mentined.

I have about 1700 entries that will need to be converted.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
Assuming you need to trim the day piece off the end this formula can be copied down referring to the cell of the string (my example uses A1)

=DateValue(Left(A1,10))

Format the entire column as Custom Date

Format>Cells>Custom and enter this :

yyyymmdd

Edit:

The length of the date would change for 2 digit days so use this

=DateValue(Trim(left(A1,11))
Book1
ABCD
14 Mar 2007 Su20070304
2
Sheet1
 

jag108

Active Member
Joined
May 14, 2002
Messages
433
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Thank you very much Gibbs
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,019
Messages
5,834,980
Members
430,331
Latest member
Syed Yasir Hannan

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
Top