Convert inconsistent dates in General format to specific date format

Nola111

Board Regular
Joined
Aug 28, 2013
Messages
119
Is there one formula that could be used in all of column B to convert data that looks like the data in column A, into column B? Column A's current format is General. The resulting format of column B can be Date, but does not have to be. If the Length of column A were consistent, I would not have a problem coming up with the formula, but because the lengths vary, and in different places, I'm struggling with coming up with a solution.

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1957-1-2[/TD]
[TD]1957-01-02[/TD]
[/TR]
[TR]
[TD]1957-6-21[/TD]
[TD]1957-06-21[/TD]
[/TR]
[TR]
[TD]1957-12-1[/TD]
[TD]1957-12-01[/TD]
[/TR]
[TR]
[TD]1957-11-11[/TD]
[TD]1957-11-11[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Assuming you want text values returned, this works for me...

=TEXT(A1,"yyyy-mm-dd")

Otherwise use Dave's suggestion in Message #3 .
 
Last edited:
Upvote 0
Wow, all three of these solutions work! I can't believe there were this many ways to go about it and I didn't think of any of them. Thank you @RickRothstein, @DavePatton and @SpillerBD!
 
Last edited:
Upvote 0
and all better than the mega-formula that parses the text.
Not recommended, but is...
Code:
=DATE(LEFT(A1,FIND("-",A1)-1),MID(A1,FIND("-",A1)+1,FIND("-",A1,FIND("-",A1)+1)-FIND("-",A1)-1),RIGHT(A1,LEN(A1)-FIND("-",A1,FIND("-",A1)+1)))
:eeek:
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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