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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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