Calculation of peak / off peak hrs v2

C

Craig

I am trying to write a macro that will automatically calculate and display,
in seperate columns, the number of hours worked in both Peak (09:00 to
19:00 - Mon - Fri) and off peak (19:01 to 08:59 Mon - Fri and all day
Saturday and Sunday), as well as to split those between Invoiced and No
Charge hours. These hours are then to be subtotalled by Suite.
The data I am working from looks as follows:

Date Suite RateCardItem Status Start End
22/07/2004 Suite1 Product1 Invoiced 10:00 11:00
21/07/2004 Suite1 Product1 Invoiced 18:30 19:30
20/07/2004 Suite1 Product2 No Charge 17:00 18:00
03/07/2004 Suite1 Product2 Invoiced 16:30 19:15
02/07/2004 Suite1 Product2 Invoiced 14:00 18:00
01/07/2004 Suite1 Product2 Invoiced 09:00 11:00
30/07/2004 Suite2 Product1 Invoiced 10:00 10:15
29/07/2004 Suite2 Product1 Invoiced 17:00 19:30
13/07/2004 Suite2 Product2 No Charge 17:00 21:00
09/07/2004 Suite2 Product2 Invoiced 12:00 19:00
09/07/2004 Suite2 Product2 Invoiced 08:00 11:00
08/07/2004 Suite2 Product2 Invoiced 09:00 13:30
08/07/2004 Suite2 Product2 Invoiced 16:30 20:30

The output should look something like this:

Date Suite RateCardItem Status Start End
Actual Peak Off Peak No Charge No Charge

Hrs Hrs Hrs Peak Hrs Off Peak Hrs
22/07/2004 Suite1 Product1 Invoiced 10:00 11:00 1.0
1.0
21/07/2004 Suite1 Product1 Invoiced 18:30 19:30 1.0
0.5 0.5
20/07/2004 Suite1 Product2 No Charge 17:00 18:00 1.0
1.0
03/07/2004 Suite1 Product2 Invoiced 16:30 19:15 2.75
2.75
02/07/2004 Suite1 Product2 Invoiced 14:00 18:00 4.0
4.0
01/07/2004 Suite1 Product2 Invoiced 09:00 11:00 2.0
2.0
Suite1 Total
11.75 7.5 0.5 1.0 2.75
30/07/2004 Suite2 Product1 Invoiced 10:00 10:15 0.25
0.25
29/07/2004 Suite2 Product1 Invoiced 17:00 19:30 2.5
2.0 0.5
13/07/2004 Suite2 Product2 No Charge 17:00 21:00 4.0
2.0 2.0
09/07/2004 Suite2 Product2 Invoiced 12:00 19:00 7.0
7.0
09/07/2004 Suite2 Product2 Invoiced 08:00 11:00 3.0
2.0 1.0
08/07/2004 Suite2 Product2 Invoiced 09:00 13:30 4.5
4.5
08/07/2004 Suite2 Product2 Invoiced 16:30 20:30 4.0
2.5 1.5
Suite2 Total
25.25 18.25 3.0 2.0 2.0

Any help would be greatly appreciated.
Thanks in advance.
Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top