Date formula?

trekcowboy

New Member
Joined
Mar 5, 2002
Messages
9
does anyone have a formula for converting numbers to dates.

ex. 03282002 = 03/28/2002

Thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
On 2002-03-28 12:21, trekcowboy wrote:
does anyone have a formula for converting numbers to dates.

ex. 03282002 = 03/28/2002

Thanks

=DATE(RIGHT(A10,4),LEFT(A10,2),MID(A10,3,2))

But, that ASSUMES that the text length is 8 characters. I mean, month 3 is shown as 03 and day 8 is shown as 08
 
Upvote 0
On 2002-03-28 12:21, trekcowboy wrote:
does anyone have a formula for converting numbers to dates.

ex. 03282002 = 03/28/2002

Thanks

Hi trekcowboy:
if 03282002 is in cell B11, then use

=DATE(RIGHT(B11,4),LEFT(B11,2),MID(B11,3,2))
 
Upvote 0
thanks to both of you, what if the month is not always two digits.

on my spreadsheet excel is dropping the leading 0

3282002

thanks again
 
Upvote 0
On 2002-03-28 12:34, trekcowboy wrote:
thanks to both of you, what if the month is not always two digits.

on my spreadsheet excel is dropping the leading 0

3282002

thanks again

Use =TEXT(REPT(0,8-LEN(A10))&A10,"00-00-0000")+0
This message was edited by Mark W. on 2002-03-28 14:40
 
Upvote 0
On 2002-03-28 13:14, Juan Pablo G. wrote:
On 2002-03-28 13:12, Mark W. wrote:

Use =TEXT(REPT(0,8-LEN(A10))&A10,"00-00-0000")+0

Mark, just confirming, this assumes that the Date system uses mm-dd-yyyy right ?

If your Regional date setting is dd/mm/yy and you enter 28032002 into cell A10 it will work as well.

If you're concerned about the dashes instead of slashes... it makes no difference.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,953
Members
448,535
Latest member
alrossman

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