Convert Number to Date

rwmill9716

Active Member
Joined
May 20, 2006
Messages
493
Office Version
  1. 2013
Platform
  1. Windows
What is the formula to convert a number like 122114 to 12/21/14 and 13015 to 01/30/15?

Thanks

Ric
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What is the formula to convert a number like 122114 to 12/21/14 and 13015 to 01/30/15?

Thanks

Ric

Try this...
=TEXT(A1,"00-00-00")*1
Format the formula cells as Date.

This assumes the "day" value always has a two digits (a leading zero for single digit days). Otherwise it doesn't know if
12915 is 1/29/2015 or 12/9/2015
 
Upvote 0
=DATEVALUE(MID(A1,3,2)&"/"&LEFT(A1,2)&"/"&(RIGHT(A1,2)))
and formatted as date

The second date could be problem when have 5 digits, try to add apostrophe " ' " when you have 01 or 02 and so on
 
Upvote 0
Accounting for the possibility of preceding zeroes....
=(LEFT(B1,LEN(B1)-4)&"/"&MID(B1,LEN(B1)-3,2)&"/"&RIGHT(B1,2))
 
Upvote 0
Thanks, Trouttrap2 and AlphaFrog, these both work fine.

Ric
 
Upvote 0
Accounting for the possibility of preceding zeroes....
=(LEFT(B1,LEN(B1)-4)&"/"&MID(B1,LEN(B1)-3,2)&"/"&RIGHT(B1,2))

oops.. that should be
=DATEVALUE(LEFT(B1,LEN(B1)-4)&"/"&MID(B1,LEN(B1)-3,2)&"/"&RIGHT(B1,2))
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

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