Normalizing utility bills into calenfar month???

PowRider

New Member
Joined
Oct 18, 2014
Messages
12
Hi smart ppl,

I have been pulling my hair out trying to write a set a vba codes that normalize utility bills into actual calendar month.
So far I have..
Column A as Reading Dates (In order from Jan-Dec) (eg. January 15, 2015)
Column B as Year (In order from smallest to largest) (eg. 2015)
Column C as Days (Billing duration) (eg. 30)
Column D as Consumption (15000kWh)
Column E as Daily Average (Col D/Col C)
Column F as Month Label (Jan, Feb etc..)
Column G as total # of days in the reading date month (eg 31)
Column H as # of days in Col A (eg 15)
Column I as Normalized consumption (calculated using H*E+(G-H)*E of next bill).

The idea end result is a pivot table with column labels as Year and Row labels as Month (12 of them) and data field as consumption.

The logic above works only when the accounts has consistent 12 bills per year (1 per month).
However, a lot of energy accounts have bi monthly bills or 2 reading dates in the same month, then my logic wouldn't work....

Maybe I should've taken a completely different route?
Does anyone have any suggestions? Any help would be appreciated.

Thanks!!
 
[TABLE="width: 1179"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]reading dates[/TD]
[TD]31/12/2013[/TD]
[TD]27/01/2014[/TD]
[TD]28/02/2014[/TD]
[TD]01/04/2014[/TD]
[TD]29/04/2014[/TD]
[TD]01/06/2014[/TD]
[TD]30/06/2014[/TD]
[TD]03/08/2014[/TD]
[TD]31/08/2014[/TD]
[TD]02/10/2014[/TD]
[TD]31/10/2014[/TD]
[TD]29/11/2014[/TD]
[TD]30/12/2014[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]reading[/TD]
[TD][/TD]
[TD]0[/TD]
[TD]1005[/TD]
[TD]2027[/TD]
[TD]3079[/TD]
[TD]4100[/TD]
[TD]5200[/TD]
[TD]6115[/TD]
[TD]7147[/TD]
[TD]8159[/TD]
[TD]9191[/TD]
[TD]10203[/TD]
[TD]12000[/TD]
[TD]13001[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]consumption[/TD]
[TD][/TD]
[TD]1005[/TD]
[TD]1022[/TD]
[TD]1052[/TD]
[TD]1021[/TD]
[TD]1100[/TD]
[TD]915[/TD]
[TD]1032[/TD]
[TD]1012[/TD]
[TD]1032[/TD]
[TD]1012[/TD]
[TD]1797[/TD]
[TD]1001[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]days[/TD]
[TD][/TD]
[TD][/TD]
[TD]27[/TD]
[TD]32[/TD]
[TD]32[/TD]
[TD]28[/TD]
[TD]33[/TD]
[TD]29[/TD]
[TD]34[/TD]
[TD]28[/TD]
[TD]32[/TD]
[TD]29[/TD]
[TD]29[/TD]
[TD]31[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]relates to[/TD]
[TD][/TD]
[TD][/TD]
[TD]jan[/TD]
[TD]feb[/TD]
[TD]mar[/TD]
[TD]apr[/TD]
[TD]may[/TD]
[TD]jun[/TD]
[TD]jul[/TD]
[TD]aug[/TD]
[TD]sep[/TD]
[TD]oct[/TD]
[TD]nov[/TD]
[TD]dec[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]days in month[/TD]
[TD][/TD]
[TD]31[/TD]
[TD]28[/TD]
[TD]31[/TD]
[TD]30[/TD]
[TD]31[/TD]
[TD]30[/TD]
[TD]31[/TD]
[TD]31[/TD]
[TD]30[/TD]
[TD]31[/TD]
[TD]30[/TD]
[TD]31[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]corrected reading[/TD]
[TD][/TD]
[TD]1154[/TD]
[TD]894[/TD]
[TD]1019[/TD]
[TD]1094[/TD]
[TD]1033[/TD]
[TD]947[/TD]
[TD]941[/TD]
[TD]1120[/TD]
[TD]968[/TD]
[TD]1082[/TD]
[TD]1859[/TD]
[TD]1001[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]is the last[/TD]
[TD]row the [/TD]
[TD]numbers[/TD]
[TD]you would[/TD]
[TD]expect[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

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