Allocate months across periods in which they fall?

malthema

New Member
Joined
Jul 16, 2012
Messages
1
Hi there,

Firstly, disclosure - I've cross-posted this from Excelforum (http://www.excelforum.com/excel-gen...months-across-periods-in-which-they-fall.html). I've not had any responses so far and could really do with a response before I waste tomorrow doing this manually!

I have several hundred date ranges i.e. 1/1/09 - 1/1/11. I'm trying to allocate the number of months in each across the financial years ended 31/7/08 - 31/7/19 e.g. months in the financial year ended 31/7/09 would return 7 months and 31/7/12 onwards would return nil. I've linked an example of what my spreadsheet looks like - https://dl.dropbox.com/u/161000/Example (1).xlsx . Hopefully this makes it fairly obvious what I'm looking to achieve!

I've found the following thread - http://excel.bigresource.com/Track/excel-5l9CSSlj/ - which is trying to achieve the same as I am, except in terms of days/months rather than months/years - however, I've not had much luck modifying the formula for my own use. The first row in the linked file gives an idea of what I've done.

So - can anyone advise where I'm going wrong? Any help would be much appreciated!



 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi try this on a set of copy data before using the original, its a horrible formula but it may save you some manual time

=IF((YEAR(J$10)-YEAR($A13))*12+MONTH(J$10)-MONTH($A13)<0,0,IF(AND(J$10-$B13<365,J$10-$B13>0),MONTH($B13)-MONTH(J$10),IF($B13<j$10,0,if((year(j$10)-year($a13))*12+month(j$10)-month($a13)>22,12,(YEAR(J$10)-YEAR($A13))*12+MONTH(J$10)-MONTH($A13)))))

you may need to amend the header dates to be 1/8/** because it counts by month numbers only so */7/09 - 1/1/11 compared to year end 31/7/09 would return zero (month 7 compared to month 7) but header 1/8/09 would return 1, depends on your count criteria

regards</j$10,0,if((year(j$10)-year($a13))*12+month(j$10)-month($a13)>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,475
Messages
6,130,847
Members
449,599
Latest member
blakecintx

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