Calculate difference in months between two dates

goodmachine

Board Regular
Joined
Oct 7, 2009
Messages
70
Hello,

I want to calculate the difference in months between two dates. For example, in cell B2, I have 12/31/2014. In cell A2, I have A2, I have 5/3/2014. The days of the month will vary, so this may be messy.

What I'm looking for is a calculation that will tell me that there would be 7 months between the two dates on the based on the months. I would like to not consider the days of the month. Is that possible.

If yes, the second part of this formula would multiply a value in cell C2 (11 in this example). Roughly what I'm looking for is something that would result in:

(B2-A2)*C2 = 77.

Thanks in advance for your help.
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

vogel997

Active Member
Joined
Jan 22, 2010
Messages
412
Try
=MONTH(B2)-MONTH(A2)
<colgroup><col width="347" style="width: 260pt; mso-width-source: userset; mso-width-alt: 12690;"> <tbody> </tbody>
 

vogel997

Active Member
Joined
Jan 22, 2010
Messages
412
Try
=MONTH(B2)-MONTH(A2)

<tbody>
</tbody>

Try
3-May31-Dec1177=(MONTH(B2)-MONTH(A2))*C2
21-May8-Feb1199=IF(MONTH(B3)-MONTH(A3)<0,MONTH(B3)-MONTH(A3)+12,MONTH(B3)-MONTH(A3))*C3
<colgroup><col width="64" style="width: 48pt;" span="3"> <col width="129" style="width: 97pt; mso-width-source: userset; mso-width-alt: 4717;"> <col width="764" style="width: 573pt; mso-width-source: userset; mso-width-alt: 27940;"> <col width="64" style="width: 48pt;"> <tbody> </tbody>
 

goodmachine

Board Regular
Joined
Oct 7, 2009
Messages
70
Try
3-May31-Dec1177=(MONTH(B2)-MONTH(A2))*C2
21-May8-Feb1199=IF(MONTH(B3)-MONTH(A3)<0,MONTH(B3)-MONTH(A3)+12,MONTH(B3)-MONTH(A3))*C3

<tbody>
</tbody>

Thank you Vogel. Your solution worked. And thanks to everybody else for contributing. Much appreciated.
 

goodmachine

Board Regular
Joined
Oct 7, 2009
Messages
70
Gorem is correct, Vogel's solution only works if the year is the same. Is there a way for this formula to consider the year in it's calculation as well?
 

Watch MrExcel Video

Forum statistics

Threads
1,099,684
Messages
5,470,120
Members
406,681
Latest member
sachinmasurkar

This Week's Hot Topics

Top