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.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try
=MONTH(B2)-MONTH(A2)
<colgroup><col width="347" style="width: 260pt; mso-width-source: userset; mso-width-alt: 12690;"> <tbody> </tbody>
 
Upvote 0
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>
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,457
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top