Spreading costs over months or as one off payments

panesai1

New Member
Joined
Dec 15, 2015
Messages
18
Hi,

I have an XL sheet which tracks my regular monthly and annual (one-off payment) expenses. (see below).

For monthly costs (eg. Electricity) i need a formula to enter the £42.00 in each of the corresponding months between the start/end dates (F2 to I2)
However, if the expense is a one-off annual payment, (i.e. the Monthly cost column is blank, e.g. Car insurance), I want the formula to place the corresponding cost only once in the corresponding month that the annual payment occured/will occur. In the case of car insurance, the £500 should appear once only in the Jan 2016 column (H4).

I have seen may forum posts that show the correct formula for spreading an annual cost over the period of a start /stop date (for instance if a cost of £12,000 was to be evenly spread out as 12*£1000 costs from Jan - Dec), but I have not seen any posts regarding my issue?

Hope someone can help?

Many thanks
Indy

ABCDEFGHI
1per monthper annumstart dateend dateNov 2015Dec 2015Jan 2016Feb 2016
2Electricity£42.004/11/137/7/16
3Council tax£103.008/5/1412/7/16
4Car insurance£500.003/1/162/1/17
5Car road tax£180.001/6/1531/5/16
6Internet bill£10.001/9/1531/3/17

<tbody>
</tbody>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
If I understand correctly, this should meet your needs. Just copy the formulas in row two down as far as necessary.

ABCDEFGHI
1per monthper annumstart dateend dateNov-15Dec-15Jan-16Feb-16
2Electricity$42.00November 4, 2013July 7, 201642424242
3Council tax$103.00May 8, 2014July 12, 2016103103103103
4Car insurance$500.00January 3, 2016January 2, 2017500
5Car road tax$180.00June 1, 2015May 31, 2016
6Internet bill$10.00September 1, 2015March 31, 201710101010

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet24

Worksheet Formulas
CellFormula
F2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(F$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=F$1,$E2>=F$1),$B2,""))
G2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(G$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=G$1,$E2>=G$1),$B2,""))
H2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(H$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=H$1,$E2>=H$1),$B2,""))
I2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(I$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=I$1,$E2>=I$1),$B2,""))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
@DRSteele: Thank you so much !!! This is absolutely fantastic. Just tried it and it works a treat. Now I'm gonna go away, lock myself in a room and try to figure out how you've pieced it all together. Thanks again!

Indy



If I understand correctly, this should meet your needs. Just copy the formulas in row two down as far as necessary.

ABCDEFGHI
1per monthper annumstart dateend dateNov-15Dec-15Jan-16Feb-16
2Electricity$42.00November 4, 2013July 7, 201642424242
3Council tax$103.00May 8, 2014July 12, 2016103103103103
4Car insurance$500.00January 3, 2016January 2, 2017500
5Car road tax$180.00June 1, 2015May 31, 2016
6Internet bill$10.00September 1, 2015March 31, 201710101010

<tbody>
</tbody>
Sheet24

Worksheet Formulas
CellFormula
F2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(F$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=F$1,$E2>=F$1),$B2,""))
G2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(G$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=G$1,$E2>=G$1),$B2,""))
H2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(H$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=H$1,$E2>=H$1),$B2,""))
I2=IF(AND(ISNUMBER($C2),EOMONTH($D2,-1)=EOMONTH(I$1,-1)),$C2,IF(AND(ISNUMBER($B2),$D2<=I$1,$E2>=I$1),$B2,""))

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Oh good show!

The formula looks to see whether or not there is a number in Per Annum as well as whether or not the month of Start Date matches the month of the current column; if so it reports the per Annum number, otherwise putting something else because of the FALSE. The second IF (which is triggered when the first IF reports a FALSE) looks to see whether or not there is a number in the Per Month column as well as whether or not the months of Start Date and End Date bookend the month of the current column; if so, it reports the Per Month Number, otherwise reporting a blank (or "" in Excel).
 
Upvote 0
Oh good show!

The formula looks to see whether or not there is a number in Per Annum as well as whether or not the month of Start Date matches the month of the current column; if so it reports the per Annum number, otherwise putting something else because of the FALSE. The second IF (which is triggered when the first IF reports a FALSE) looks to see whether or not there is a number in the Per Month column as well as whether or not the months of Start Date and End Date bookend the month of the current column; if so, it reports the Per Month Number, otherwise reporting a blank (or "" in Excel).



Hi DRSteele: This is very very helpful for a novice/learner such as myself. Thanks again for everything !

Indy
 
Upvote 0
Hi again...

Sorry, to re-bump my own thread when I had thought it was all resolved.... but I just noticed two nuances....


  1. The following seems to happen for whichever month is used as start date:
    • When there is a cost in the "per month" column, and start date is the first day of the month (eg. 01-Jan-2016), the cost is correctly displayed in the Jan 2016 column.
    • But, when there is a cost in the "per month" column, and start date is NOT the first day of the month (eg. 02-31 Jan 2016), the cost is NOT displayed in the Jan 2016 column. (but does display in correctly subsequent months, provided that the end date has been set sufficiently in to the future. So in this case, the costs are displayed from Feb 2016 onwards)
  2. When there is a cost in the annual column (eg. £50), and a Start and End date are entered (04-Jul-2016 start , end 04-Jul-2025), the cost is correctly displayed only in the Jul-2016 column, but does not repeat in subsequent years (as per end date, it should repeat every July until year 2025).

Any ideas?

Many thanks in advance

Indy
 
Upvote 0
It's not a "re-bump" --- the problem has not been solved, so post away until we're done. I've invented some more data to help us to get to the bottom of this.

I fixed my oversight in point 2; I stupidly thought it was a one-time payment. Now the formula will report a figure when a per annum payment month matches the month in the column and the year in the column is bookended by the payment start and end years. See below.

I don't quite follow what you mean in point 1; are you suggesting that my 37 payment on Dec 17/15 should show up in the Dec 1/15 column? Note that the dates in Row1 are all the first day of the month. Could you please clarify point 1?

ABCDEFGHIJKLM
1per monthper annumstart dateend dateNov 1, 2015Dec 1, 2015Jan 1, 2016Feb 1, 2016Jan 1, 2017Jul 1, 2019Jul 1, 2025Jul 1, 2026
2Electricity$42.00Nov 4, 2013Jul 7, 201642424242
3Council tax$103.00May 8, 2014Jul 12, 2016103103103103
4Car insurance$500.00Jan 3, 2016Jan 2, 2017500500
5Car road tax$180.00Jun 1, 2015May 31, 2016
6Internet bill$10.00Sep 1, 2015Mar 31, 20171010101010
7Beer exam$50.00Jul 4, 2016Jul 4, 20255050
8Bacon ration$37.00Dec 17, 2015Jun 30, 20263737373737

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet24

Worksheet Formulas
CellFormula
F2=IF(AND(ISNUMBER($C2),MONTH($D2)=MONTH(F$1),YEAR($D2)<=YEAR(F$1),YEAR($E2)>=YEAR(F$1)),$C2,IF(AND(ISNUMBER($B2),$D2<=F$1,$E2>=F$1),$B2,""))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
It's not a "re-bump" --- the problem has not been solved, so post away until we're done. I've invented some more data to help us to get to the bottom of this.

I fixed my oversight in point 2; I stupidly thought it was a one-time payment. Now the formula will report a figure when a per annum payment month matches the month in the column and the year in the column is bookended by the payment start and end years. See below.

I don't quite follow what you mean in point 1; are you suggesting that my 37 payment on Dec 17/15 should show up in the Dec 1/15 column? Note that the dates in Row1 are all the first day of the month. Could you please clarify point 1?

ABCDEFGHIJKLM
1per monthper annumstart dateend dateNov 1, 2015Dec 1, 2015Jan 1, 2016Feb 1, 2016Jan 1, 2017Jul 1, 2019Jul 1, 2025Jul 1, 2026
2Electricity$42.00Nov 4, 2013Jul 7, 201642424242
3Council tax$103.00May 8, 2014Jul 12, 2016103103103103
4Car insurance$500.00Jan 3, 2016Jan 2, 2017500500
5Car road tax$180.00Jun 1, 2015May 31, 2016
6Internet bill$10.00Sep 1, 2015Mar 31, 20171010101010
7Beer exam$50.00Jul 4, 2016Jul 4, 20255050
8Bacon ration$37.00Dec 17, 2015Jun 30, 20263737373737

<tbody>
</tbody>
Sheet24

Worksheet Formulas
CellFormula
F2=IF(AND(ISNUMBER($C2),MONTH($D2)=MONTH(F$1),YEAR($D2)<=YEAR(F$1),YEAR($E2)>=YEAR(F$1)),$C2,IF(AND(ISNUMBER($B2),$D2<=F$1,$E2>=F$1),$B2,""))

<tbody>
</tbody>

<tbody>
</tbody>

Thanks again DRSteele!

So for point 1, what i mean.... using your example in Row 8 (Bacon ration) above....
  • As you can see in your table, the first instance of Bacon Ration occurs in Dec 2015 (17th day). Therefore there should be an entry of $37 in cell G8. However, there is no entry, and the entries only begin from H8, I8, J8 onwards.
  • However, you will find, if you change the start date of Bacon Ration to Dec 01, 2015, suddenly $37 will appear in cell G8.
  • Dec 01, 2015 is the only start date that correctly enters $37 in cell G8. If you change the date to Dec 02, 2015; Dec 03, 2015, etc.... it will fail to show an entry in cell G8.

Hope it makes sense?

Indy
 
Upvote 0
I see I had mistakenly inferred that you did not want any payments that occurr mid-month to be included in that month's columns. I think finally knocked the sticky wicket:

Put this in F2 and copy AcrossAndDown

Code:
=IF(AND(ISNUMBER($C2),MONTH($D2)=MONTH(F$1),YEAR($D2)<=YEAR(F$1),YEAR($E2)>=YEAR(F$1)),$C2,IF(AND(ISNUMBER($B2),(EOMONTH($D2,-1)+1)<=F$1,$E2>=F$1),$B2,""))

P.S. No need to reply with quotes...the post will become monstrous!
 
Upvote 0

Forum statistics

Threads
1,215,137
Messages
6,123,253
Members
449,093
Latest member
Vincent Khandagale

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