Hi there, I have two cells with dates in them:
eg.
cell k11 has 2009-10-23 in it and cell l11 has 2011-10-13.
I have subtracted the two to get an answer. The answer it gives is 2-1 (2 years and 1 month - This is clearly wrong.
(I used the following formula:
=YEAR(L11)-YEAR(K11)+MIN(0,SIGN(MONTH(L11)+MONTH(K11)))&"-"&MONTH(L11)-MONTH(K11)-MIN(0,SIGN(DAY(L11)-DAY(K11)))+MIN(0,SIGN(MONTH(L11)-MONTH(K11)))*-12&""
How do I do it? What have I done wrong? The answer must be in that exact format: 1-11. I am not interested in the days.
eg.
cell k11 has 2009-10-23 in it and cell l11 has 2011-10-13.
I have subtracted the two to get an answer. The answer it gives is 2-1 (2 years and 1 month - This is clearly wrong.
(I used the following formula:
=YEAR(L11)-YEAR(K11)+MIN(0,SIGN(MONTH(L11)+MONTH(K11)))&"-"&MONTH(L11)-MONTH(K11)-MIN(0,SIGN(DAY(L11)-DAY(K11)))+MIN(0,SIGN(MONTH(L11)-MONTH(K11)))*-12&""
How do I do it? What have I done wrong? The answer must be in that exact format: 1-11. I am not interested in the days.