# Electrical Bill

D

#### Den

From the electrical bill (variable: 50 to 60 days) I want to figure a
monthly consumption base on the following approach:

From this:

Date Consumption Nb Days Consp/day
2005-02-17 3370 64 52.65
2005-04-21 3270 63 51.90
2005-06-15 860 55 15.63

I would like to get this:

Jan consumpt. = 31 days x 52.65 = 1632.15 total: 1632.15
Feb consumpt. = 17 days x 52.65 = 895.05

Feb consumpt. = 21 days x 51.90 = 1089.90 total: 1984.95
Mar consumpt. = 31 days x 51.90 = 1608.90 total: 1608.90

Apr consumpt. = 21 days x 51.90 = 1089.90
Apr consumpt. = 9 days x 15.63 = 140.67 total: 1230.57

May consumpt. = 31 days x 15.63 = 484.53 total: 484.53
June consumpt. = 15 days x 15.63 = 234.45

June (completed with the next bill)

Naturally, there's only one line per month in the final version.

Problem is that each bill spans over 3 months and the last month is
only completed with the coming bill.

Can this be done with just the excel functions or will I have to go
with VB ?

Den