Looking for Formula Or Macro To Fix Date Formatting Problem

Excelmancan

New Member
Joined
Jun 27, 2010
Messages
32
Hi Everyone,

Here is my issue. I have a large dataset that I download from an outside source from time to time. All is good except the dates. Is there a way that a formula or a macro can be created that would convert the format that is seen below in the 1st 6 example dates that we be returned in the format as seen with the balance without affecting the "good dates".

2012-01-17
2012-03-17
2012-05-17
2012-08-17
2012-09-17
2012-12-17
12/14/17
12/17/17
12/19/17
12/23/17
12/27/17
12/28/17
12/31/17

<colgroup><col></colgroup><tbody>
</tbody>

Thanks.
 
Or better yet, when they were uploaded - they did not upload properly. Part of it came in as 2010 instead of 2017. The first 3 dates should actually be Oct 6th, 7th and 10th in 2017 respectively. I guess the question now is, what kind of formula can be made to convert these to the proper date in 2017 as mentioned.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
The below adjusted formula should work but honestly I would really be concerned about the data ... Perhaps you can fix the data source

=IF(--ISNUMBER(A1)=0,DATE(MID(A1,7,2)+100,MID(A1,1,2),MID(A1,4,2)),DATE(DAY(A1)+2000,YEAR(A1)-2000,MONTH(A1)))
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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