Dates

L

lsmft

I have two dates: 04/16/04, and 06/20/05.
I want to get the difference of time between the two in mm/dd/yy.
I subtracted 04/16/04 from 06/20/05 and got the answer of 03/05/01,
which would mean 3 months, 5 days, 1 year.
Shouldn't it be correctly stated as 2 months, 4 days, 1 year?
What have I done wrong?
 
M

MattShoreson

03/05/01 is actually 03/05/1901.

If you format you cell to numbers you should get 430
 
G

Guest

In A1, put 38093
In A2, put 38523
In A3, put =DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & "
months, " & DATEDIF(A1,A2,"md") & " days"

In order to see:

4/16/2004
6/20/2005
1 years, 2 months, 4 days
 
M

MattShoreson

03/05/01 is actually 03/05/1901.

To work out how many e.g. days you'll have to use
=DAY(cellref)-day(cellref2)


Not sure why you would want to do though as 2days, 4 months and a year
wont equate to 430 days, (the difference between the two).
 
J

JE McGimpsey

XL stores dates as integer offsets from a base date. When you subtract a
date from another date, you get the number of days as a result, but XL
is stupid enough to think that the result should be formatted as a date.
If you format the result as general, you'll get the number of days.
 
L

lsmft

Mattshoreson,
The dates were April 16, 2004 and June 20, 2005, hence the 2 months/
days/ 1 year.
Thanks for your help.

Gary"s Student, you formula did exactly what I needed. Thanks to all o
you for your help
 

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

Top