How to convert a number "eg: 19521016" to date format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a date that is noted in this format : 19521016 where 1952 is year, 10
is month, and 16 is date.

Now how to convert this to dd/mm/yyyy format.
 
In a sheet, you could use a formula like the following to convert the number
to a date and format it any way you'd like:

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

where the date is in cell a1. In VBA, you could do the same thing using the
Left, Mid and DateSerial functions.

Stuart
 
At the simplest level,assuming your date is in cell B10 then

19521016
c10 =LEFT(B10,4)
d10 =MID(B10,5,2)
e10 =RIGHT(B10,2)
f10 =DATE(C10,D10,E10)
and apply custom format "dd/mm/yyy"
 
Simpler:

Select the cell. Choose Data/Text to Columns. Click Next, Next. Choose
YMD from the Date dropdown. Click Finish.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top