Calculate number of months

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
 
G

google

=((YEAR(TODAY())*12)+MONTH(TODAY()))-((YEAR(D3)*12)+MONTH(D3))

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

....should work for just about anything.
 
S

SKelly

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)
 
R

Rick Rothstein

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.
 
S

Shane Devenshire

Hi,

Since you are working with dates you can use

=DATEDIF(D3,NOW(),"m")
 
Top