Convert number to date

fearless2002uk

New Member
Joined
Jan 30, 2003
Messages
1
I have a spreadsheet with a column of 3500 numbers (in this format 20030129 or 19971112 for example) they are infact dates - I am struggling to format them as such. HELP!

Many thanks in advance
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You will have to use a formula to convert them - they won't be recognised as dates by Excel.

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

Change the reference to A1 as required and choose your date format.
 
Upvote 0
=TEXT(A1,"0000-00-00")+0

Format the cell containing this formula with an appropriate date format.
This message was edited by Mark W. on 2003-01-31 13:30
 
Upvote 0
On 2003-01-31 13:29, Mark W. wrote:
=TEXT(A1,"0000-00-00")+0

Format the cell containing this formula with an appropriate date format.
This message was edited by Mark W. on 2003-01-31 13:30

Cool!
 
Upvote 0
I am trying to convert 38370 to date 19-Jan-2009.
Using formula =DATE(RIGHT(A1,2),MID(A1,5,2),LEFT(A1,4)).
But it gives starnge date.

Number 38370 is generated by converting date "19-Jan-2009" to general format in excel sheet.
 
Upvote 0
This by far makes most sense.
But what does +0 do in the function? Does it make the cell numeric?
Yes

The TEXT( ) function returns a TEXT data type even if looks like a number.

The math operation of adding 0 (+0) coerces the text string that represents a date into the true numeric date value.

Another way to do it is:

=--TEXT(A1,"0000-00-00")
 
Upvote 0
Yes

The TEXT( ) function returns a TEXT data type even if looks like a number.

The math operation of adding 0 (+0) coerces the text string that represents a date into the true numeric date value.

Another way to do it is:

=--TEXT(A1,"0000-00-00")


That is awesome. I knew taking a couple of programming courses at university should help understand Excel functions better in the future, haha!

Thanks so much for your explanation.
 
Upvote 0
That is awesome. I knew taking a couple of programming courses at university should help understand Excel functions better in the future, haha!

Thanks so much for your explanation.
You're welcome. Thanks for the feedback! :cool:
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,122
Members
448,550
Latest member
CAT RG

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