Time Calculation

  • Thread starter Thread starter Syed Zeeshan Haider
  • Start date Start date
S

Syed Zeeshan Haider

Hello Experts,
I have Excel 97 Pro on Win98 SE.

I am trying to get the difference of months between two dates by using
following formula:

="October 2003"-"August 2000"

But I am getting 1156 as the result. What is this value?

How to get the difference of months?

Thank you,
 
Syed,

When you don't specify a day in a date, Excel uses the first day
of the month, so your formula is simply subtracting 1-Aug-2000
from 1-Oct-2003, and the result is the number of days, 1156. To
get the difference in months, use the DATEDIF function.

=DATEDIF("Aug 2000","Oct 2003","M")

See www.cpearson.com/excel/datedif.htm for more information about
DATEDIF.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Syed Zeeshan Haider" <[email protected]>
wrote in message
news:%233%[email protected]...
 
Hi

The number you're seeing is the number of days between the two dates
To get the number of months, try this:

=DATEDIF("August 2000","October 2003","m")

Cheers,

Graha
 
Syed,

When you don't specify a day in a date, Excel uses the first day
of the month, so your formula is simply subtracting 1-Aug-2000
from 1-Oct-2003, and the result is the number of days, 1156. To
get the difference in months, use the DATEDIF function.

=DATEDIF("Aug 2000","Oct 2003","M")

Thank you very much! It worked.
See www.cpearson.com/excel/datedif.htm for more information about
DATEDIF.

This link is important in two ways:
1. DATEDIF has not been documented by MS. This link is a great resource
for understanding this function.
2. It points to many other useful resources.
Cordially,
Chip Pearson
Microsoft MVP - Excel

Can MVP's like you suggest Microsoft to modify their documentations
(considering the unavailability of DATEDIF in Excel 97 and 2002
documentations?

Thanks again!
 
Hi

The number you're seeing is the number of days between the two dates.
To get the number of months, try this:

=DATEDIF("August 2000","October 2003","m")

Thanks! It works very well.
 
Back
Top