Calculate difference between two dates based on year selection

vikrampnz

Board Regular
Joined
Jun 20, 2006
Messages
92
Office Version
  1. 2007
Platform
  1. Windows
Hello

I am trying to figure out if there is a way I can calculate "number of months" between two dates , but display it year wise.

For example, I have Start Month as "Aug-18" in A1 and Current Month automatically displayed as "Oct-20" in B1. When I use DATEDIF function, it gives me 26 as number of months.

I am trying to achieve a way where I can have yearwise split of no. of months i.e.

2018 - 4
2019 - 12
2020 - 10

I am having a different monthly rate for each year, which I want to apply to no. of months in that year to calculate accrued amount, hence the split.

Here's the example:

2018 - 4 * 7000 = 28,000
2019 - 12 * 7500 = 90,000
2020 - 10 * 8000 = 80,000

Can anyone suggest a way I can get number of months by the calender year?

Thanks
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Watch MrExcel Video

Forum statistics

Threads
1,126,957
Messages
5,621,823
Members
415,859
Latest member
Vain

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
Top