Calculate number of months

  • Thread starter Thread starter TxWebDesigner
  • Start date Start date
T

TxWebDesigner

Hello,

I have a field where I am trying to implement a calculation. I want it to
take the date in a cell and subtract it from today's date to show me the
total number of months between those two dates. So right now, it looks like
=(TODAY())-D3 and it returns 167 - the total number of days. How do I make
it show me months?

THANK YOU IN ADVANCE
 
=((YEAR(TODAY())*12)+MONTH(TODAY()))-((YEAR(D3)*12)+MONTH(D3))

Then Format->Cells->Number->Custom = 0 "months"

....should work for just about anything.
 
Does it cross over Year-to-year?
What about something like 11/1/2008 to 2/28/2009?

If so, you may want to have your formula be:

=Month(Today())-Month(D3) + 12 * Year(Today())-Year(D3)
 
Try using the undocumented DATEDIF function...

=DATEDIF(D3,TODAY(),"m")

where the first argument's date must be an earlier (or equal) date than the
second argument's date.
 
Back
Top