Calculate values with a maximum ceiling, spilling whats left to the next

TenTwenty

New Member
Joined
Feb 20, 2018
Messages
14
I have the following table. Problem is I really am stuck with this one. Columns in red are the ones I'm testing against. The values entered in columns E,H, K and N will be tested against the values in columns F, H, K and N. The latter columns in a ceiling and if the calculated value in E,H, K and N exceed the ceiling then it will spill over to the next. That is working sort of but the problem is when the month are the same for two or more rows.

Below is the table values with the formulas that I use.


Excel 2016
ABCDEFGHIJKLMNO
1DateMonthReadingTest1Tarif1Cap1Test2Tarif2Cap2Test3Tarif3Cap3Test4Tarif4Cap4
21/7/18July5505050502502502503000
31/8/18August5705050502502702503000
415/8/18August280005000250300250
520/8/18August320005000250300320
625/8/18August180005000250300180
72/9/18Sept1200505050250900250300600

<tbody>
</tbody>
Formulas
B2=TEXT(A2,"mmmm")
F2=IF(C2>F2,IF(B2=B1,0,F2),C2)
H2=IF(C2>F2+I2,IF(B2=B1,0,IF(280-0-250>I2,IF(B2=B1,0,I2),C2-E2-I2)),IF(H2>0,C2-F2,C2))

<tbody>
</tbody>

<tbody>
</tbody>
 
@oldbrewer,
I'm not billed. Go to the store and buy the electricity. Hope that what you buy at the start of the month will be enough to cover the month.... :). If you don't buy enough or their was exceptional usage, then you will have two entries for the same month.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
in the UK that is the most expensive way to pay for electricity - however - if you read your meter at say 9 pm everyday you can get some idea of how much you are using by calculating rolling averages, but are there predictable future times when you expect to use more - will knock up a spreadsheet in the next 5 minutes
 
Upvote 0
datemeterreadingunitsused7dayrollaveavedailyconsumption
28/06/20183049
29/06/2018305344.0
30/06/2018305412.5
01/07/20183067136.0
02/07/2018307035.3
03/07/20183082126.6
04/07/20183098168.2
05/07/2018310137.47.4in this example you could use as much as 18.0
06/07/20183114138.78.1or as little as zero
07/07/2018312289.78.1
08/07/2018312538.37.6
09/07/201831441910.68.6it is clear that your ave daily consumption is around 8
10/07/2018315179.98.5
11/07/2018315107.67.8
12/07/20183161108.68.0
13/07/2018317098.08.1
14/07/20183181118.48.3
15/07/2018318548.68.0
16/07/2018318836.37.7
17/07/20183205177.78.2
18/07/201832231810.38.7
19/07/201832351210.68.9
20/07/2018323509.38.5
21/07/2018324168.68.3
22/07/2018324328.38.1
23/07/2018324858.68.0
24/07/2018325136.67.8
25/07/2018325324.37.6
26/07/20183266134.47.8
27/07/20183281156.68.0
28/07/20183292117.38.1
29/07/2018
30/07/2018
31/07/2018
01/08/2018
02/08/2018
03/08/2018
04/08/2018
05/08/2018
06/08/2018
07/08/2018
08/08/2018
09/08/2018
10/08/2018
11/08/2018

<colgroup><col><col><col><col><col><col span="7"></colgroup><tbody>
</tbody>
 
Upvote 0
@oldbrewer,
Jip, I know (everything to screw us over in the good SA)

I guess I know that during holidays I can already see the spike as well as during winter. That is nice and it sort of reflect as it should. I have to enter it by hand though and would like to automate it. Sometimes I miss it by three or some days and other months there is an excess of three or more days. Overall I'm fine, I guess it is just the part of doing everything by hand. It absolutely kills me.
 
Upvote 0
if you miss a day's reading put in the average daily consumption it will auto correct when you put in a true reading

I am signing out for now will restart tomorrow
 
Upvote 0
Are you trying to calculate your electric bill based on tiered pricing? And if so, can you explain the rate plan?
 
Upvote 0
@shg

Hi there,
Yes, I am.

Here are the rules
Resets at the start of each month.
50 units @ 0.9743
300 units @ 1.2312
250 units @ 1.8500
100 units @ 2.1818
Rest @ 2.2500

Ex. 700 units bought on 1/8/18
50 to the first tier (650 left)
300 to the second tier (350 left)
250 to the third tier (100 left)
100 to the fourth tier (0 left)

Buy another 300 units on the 20th of the same month
0 to the first tier (300 left) - already maxed out at the first purchase
0 to the second tier (300 left) - already maxed out at the first purchase
0 to the third tier (300 left) - already maxed out at the first purchase
300 to the fourth tier (0 left)

I try to buy on a monthly basis. Not that rough to calculate. Problem is when I have two or more entries for the same month.

Hope this help.
 
Upvote 0
Does any unused amount roll over to the following month?
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

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