Thread: Date conversion
View Single Post
  #3   Report Post  
Harald Staff
 
Posts: n/a
Default

Hi

This is a little confusing; if you have 041006 as a real number, it should
not display the leading 0. amd your left and mid function would err. Give
this a try:

=DATE(1900+MOD(A1,100)+100*(MOD(A1,100)<50),MOD(IN T(A1/100),100),INT(A1/1000
0))

The 50 means
49 = 2049
50 = 1950
change to suit your needs.

HTH. Best wishes Harald


"Gerrym" skrev i melding
...
I want to convert a number i.e. 041006 into a date, having
formatted the new cell as date: dd/mm/yyy. When I use
the formula =DATE(left(D13,2),MID(D13,3,2),right(D13,2)
I get the date 06/10/1904, when it should be 06/10/2004.
Any suggestions please