formula to calculate based on date

aelk5579

New Member
Joined
Jul 24, 2018
Messages
2
Hi,

I am trying to veryify my power bill and have raw meter readings showing kwh consumed in every half hour interval

Is there a formula I can use to calculate the price I should be charged per half hour block?


I am on time of use so i get charged as follows


between 7am and 1pm mon - fri - shoulder rate (0.31/kwh)
between 1pm and 8pm mon - fri - peak rate (0.41/kwh)
all other times (all day weekends) - off peak (0.17/kwh)

example of raw data


6/04/2018 0:006/04/2018 0:291.594kwh
<colgroup><col width="113" style="width: 85pt; mso-width-source: userset; mso-width-alt: 4010;" span="2"> <col width="117" style="width: 88pt; mso-width-source: userset; mso-width-alt: 4152;"> <tbody> </tbody>



I have 4500 lines in excel and hoping I dont need to calculate manually per line

Thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the forum.

I think this is what you're after. I created sample data for testing purposes.

The Begin and End columns are formatted as Excel Dates and Times. The Begin column is formatted as m/dd/yy h:mm AM/PM and the End column as m/dd/yy h:mm:ss AM/PM. Notice that the End column is superfluous anyway. The Weekday column is fyi; it is simply =A8 and is formatted DDDD.

Copy the formulas downwards.


Book1
ABCDEF
100.17
2between 7am and 1pm mon - fri - shoulder rate (0.31/kwh)6:59:59 AM0.31
3between 1pm and 8pm mon - fri - peak rate (0.41/kwh)12:59:59 PM0.41
4all other times (all day weekends) - off peak (0.17/kwh)7:59:59 PM0.17
5
6
7BeginEndWeekdayUsage (kwh)Rate ($/kwh)Cost
86/04/18 12:00 AM6/04/18 12:29:59 AMMonday1.5940.17$0.2710
96/05/18 8:00 AM6/05/18 8:29:59 AMTuesday2.0000.31$0.6200
106/06/18 3:00 PM6/06/18 3:29:59 PMWednesday3.0000.41$1.2300
116/07/18 8:00 PM6/07/18 8:29:59 PMThursday5.0000.17$0.8500
126/08/18 4:00 AM6/08/18 4:29:59 AMFriday6.0000.17$1.0200
136/09/18 2:00 PM6/09/18 2:29:59 PMSaturday7.0000.17$1.1900
Sheet19
Cell Formulas
RangeFormula
B8=A8+1/48-1/24/60/60
C8=A8
E8=IF(OR(WEEKDAY(A8,2)=6,WEEKDAY(A8,2)=7),$F$1,VLOOKUP(MOD(A8,1),$E$1:$F$4,2))
F8=D8*E8
 
Upvote 0
Thanks alot for this.. it works perfectly :)
Just wondering if it would be possible to alter the formula to add one more tarrif.. between 8pm and 10pm weekdays it would be should rate 0.31.. I have modified the table below


A
BCDEF
100.17
2between 7am and 1pm mon - fri - shoulder rate (0.31/kwh)6:59:59 AM0.31
3between 1pm and 8pm mon - fri - peak rate (0.41/kwh)12:59:59 PM0.41
4all other times (all day weekends) - off peak (0.17/kwh)7:59:59 PM0.17
5between 8pm and 10pm mon - fri - shoulder rate (0.31/kwh)7:59:59 PM

<tbody>
</tbody><thead>
</thead><tbody>
</tbody>
Thanks again.. you saved me hours and hours of doing this manually :)
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,046
Members
449,063
Latest member
ak94

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