Excel Date Help

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

Guest

I am trying to write a formula that will change the date format. Here is what
I am trying to do. Can anyone help?

I would like the date to be in this format in cell F1, 19971219. This field
needs to have 8 digits for the complete date.

Cell A1 Contains the year, 1977
Cell B1 Contains the month, 12
Cell C1 Contains the day, 19

In this example we would have to append a leading zero on the month so it is
05 instead of just the 5. The same with the day it needs to have a leading 0
also.

Cell A1 Contains the year, 1977
Cell B1 Contains the month, 9
Cell C1 Contains the day, 5

I would like the date to be in this format in cell F1, 19970905

What is the best way to do this?

Thanks in advance.

Robert





Thanks
 
=date(a1,b1,c1)
and give it a nice format (yyyymmdd)

or if you want text:
=text(date(a1,b1,c1),"yyyymmdd")

The first will still be a date, so you can do all the date arithmetic you want.
The second will be text.
 
Back
Top