Date Conversion

catchg

New Member
Joined
Jan 31, 2013
Messages
12
I have a column of imported data that represents dates. An example of the data follows:

10812 which is supposed to be the date August 1, 2012
50812 which is supposed to be the date August 5, 2012
250812 which is supposed to be the date August 25, 2012

Please note that there are not any leading zeros in the raw, imported data.

I would like to have in a second column a formula that will convert the data to mm/dd/yy.

So, how can I convert the 5 digit value 10812 in cell A2 to display the date 08/01/12 in cell B2 while also keeping in mind that 6 digit data like 250812 needs to be converted to 08/25/12 as well.

Any assistance would be greatly appreciated. Thanks in Advance!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Sorry Jon, still not working.
Works in US settings
In UK:
10812 = January 8 2012
50812 = May 8 2012
250812 = #VALUE!
 
Upvote 0
Sorry Jon, still not working.
Works in US settings
In UK:
10812 = January 8 2012
50812 = May 8 2012
250812 = #VALUE!
Yes I was after a US solution. I believe my 1st suggestion works for UK (my machine is on UK settings). :)
 
Upvote 0
Doh!

=--TEXT(REPLACE(RIGHT(A3,4),3,0,LEFT(TEXT(A3,"000000"),2)),"00\/00\/00")
Yes, that works here in the US, but does it work when the regional setting is for d/m/y (I would think not as it is my understanding that the slash format gets interpretted according to the computers regiona/locale setting)?
 
Upvote 0
This is why it's best to use Unambiguous solutions, like using The Date function.
Or some method that actually spells out the name of the month, like Rick did in post #6
 
Upvote 0
This is why it's best to use Unambiguous solutions, like using The Date function.
Or some method that actually spells out the name of the month, like Rick did in post #6
Yup - the formula that works on both settings is a clear winner :) I just didn't want to be the guy that only offered a formula that doesn't work; albeit it works on UK setting. :p
 
Upvote 0
Jon, using your solution works for lets say 010113 (yielding 01/01/13) but does not work on say 250113 (it yields 01/02/13 instead of 01/25/13). Or lets say 121213 yields 12/01/13 instead of 12/12/13. Sorry but no praise for you :) ...But works in UK :)
 
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,905
Members
449,478
Latest member
Davenil

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