Thread: Dates formula
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Thomas Dave Thomas is offline
external usenet poster
 
Posts: 146
Default Dates formula - Correction to previous post.

You can use the DATEDIF function.

This function from Lotus 1-2-3 is documented by Microsoft only in Excel
2002, but has been around since Excel 5

Its format is =DATEDIF(start_date,end_date,"F"). Note that start_date must
be less or equal to end_date or you will get a #NUM error.
F must be in quotes and may be the following:

"y" The number of complete years in the period
"m" The number of complete months in the period
"d" The number of days in the period.
"md" The difference between the days in start_date and
end_date. The months and years of the dates are ignored.
"ym" The difference between the months in start_date and
end_date. The days and years of the dates are ignored.
"yd" The difference between the days in start_date and
end_date. The years of the dates are ignored.

So if cell A1 has 01/01/2007 and cell B1 has 07/21/2007 then
=DATEDIF(A1,B1,"d") would return 201, the number of days difference between
those dates.

This function is also documented at:
http://www.cpearson.com/excel/datedif.htm

"Dave Thomas" wrote in message
. net...
You can use the DATEDIF function.

This function from Lotus 1-2-3 is documented by Microsoft only in Excel
2002, but has been around since Excel 5

Its format is =DATEDIF(start_date,end_date,"F"). Note that start_date must
be less or equal to end_date or you will get a #NUM error.
F must be in quotes and may be the following:

"y" The number of complete years in the period
"m" The number of complete months in the period
"d" The number of days in the period.
"md" The difference between the days in start_date and
end_date. The months and years of the dates are ignored.
"ym" The difference between the months in start_date and
end_date. The days and years of the dates are ignored.
"yd" The difference between the days in start_date and
end_date. The years of the dates are ignored.

So if cell A1 has 01/01/2007 and cell B1 has 07/21/2007 then
=DATEDIF(A2,A1,"d") would return 201, the number of days difference
between those dates.

This function is also documented at:
http://www.cpearson.com/excel/datedif.htm

"davey" wrote in message
ups.com...
I have 2 date columns. I would like a formula in a 3rd column to tell
me the differance in days of the two date columns