On Tue, 12 Jun 2007 08:46:01 -0700, Pammy
wrote:
If I have 2 date columns how do I create a formula to subtrack? example:
(b4) November 30, 2007 and (c4) November 6, 1986. My formula is:
=month(b4)-month(c4) in column D, but I get 0 and I have formatted the
column to numbers.
I also did =month(c4)-month(b4). Is there another way to this to get the
correct #?
Here's why you get zero:
MONTH worksheet function: Returns the month of a date represented by a serial
number. The month is given as an integer, ranging from 1 (January) to 12
(December).
B4: November 30, 2007
=MONTH(B4) -- 11 (November is the eleventh month)
C4: November 6, 1986
=MONTH(C4) -- 11 (November is the eleventh month).
11-11 = 0
You can use the undocumented DATEDIF function
=DATEDIF(C4,B4,"m")
For documentation, see
http://www.cpearson.com/excel/datedif.htm
--ron