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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,172
Members
449,071
Latest member
cdnMech

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