How can I count the number of months between 2 dates?

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

Guest

For instance, I am trying to compute how many months are left in leased
equipment contracts. I have a spreadsheet with the ending dates for all the
individual contracts.
What I would like to be able to do is to calculate the number of months
between now and the end of the contract.

I appreciate any help.

Thanks
Tom
 
What I would like to be able to do is to calculate the number of months
between now and the end of the contract.

Ostensibly:

=datedif(today(), A1, "m")

where A1 has the contract end-date.

But that may or may not give you the answer you want in all
circumstances. For example, if today is 4/20/2007 and the contract
end-date is 5/15/2007, do you really want the answer to be zero?

That is what the above formula gives you. If your answer is "no", you
might want something like the following:

=datedif(today(), A1, "m") + (day(A1) < day(today()))

If the "(...<...)" expression is confusing, you could write the
following, which might be more understandable:

=datedif(today(), A1, "m") + if(day(A1) < day(today()), 1, 0)
 

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

Back
Top