Hi,
I have been asked to create a spread sheet that takes the start and end times of and activity and calculates total time. Along with this, it also need to work out fuel used for each activity.
I am not an excel expert, and have managed so far with functions (mainly IF's). However for working out the fuel used is proving to be far more difficult, as it does not include data in every row for each column, and in addition there is also fuel added from time to time.
I fear that, I am moving into the realm of VBA, which I do not know anything about. So far to calculate fuel used, I have had to create a Fuel at Start column and a Fuel at End column and then some hidden columns where I do the calculations. This part works fine, though having a start and end column is clumsy, as you will see when you look at the sheet.
The section where I become most stuck is then working out the running totals of fuel used, as I need to start adding when more is taken.
If there is anyone who can help me I would be very grateful, sorry to sound ignorant, but I am not at all familiar with VBA and excel, so please be patient and make your response simple!
I am using Excel2003, with Windows XP
Excel 2003
I have been asked to create a spread sheet that takes the start and end times of and activity and calculates total time. Along with this, it also need to work out fuel used for each activity.
I am not an excel expert, and have managed so far with functions (mainly IF's). However for working out the fuel used is proving to be far more difficult, as it does not include data in every row for each column, and in addition there is also fuel added from time to time.
I fear that, I am moving into the realm of VBA, which I do not know anything about. So far to calculate fuel used, I have had to create a Fuel at Start column and a Fuel at End column and then some hidden columns where I do the calculations. This part works fine, though having a start and end column is clumsy, as you will see when you look at the sheet.
The section where I become most stuck is then working out the running totals of fuel used, as I need to start adding when more is taken.
If there is anyone who can help me I would be very grateful, sorry to sound ignorant, but I am not at all familiar with VBA and excel, so please be patient and make your response simple!
I am using Excel2003, with Windows XP
Excel Workbook | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
D | E | F | J | K | L | M | N | O | P | Q | R | S | |||
5 | Levels At Start | Levels At End | Consumption | Reason | |||||||||||
6 | FO | LO | FW | FO | LO | FW | FO | LO | FW | ||||||
7 | 577 | 333318 | 355 | 677 | 333318 | 355 | Mobilisation | ||||||||
8 | 100 | 0 | 0 | 0 | Bunkered | ||||||||||
9 | 0 | 0 | 0 | Stand By | |||||||||||
10 | 404 | 30317 | 110 | 399 | 33225 | 250 | 5 | 300 | 10 | 5 | 300 | 10 | Full Fee | ||
11 | 3208 | 150 | 0 | 0 | 0 | Bunkered | |||||||||
12 | 399 | 33225 | 250 | 323 | 32475 | 200 | 76 | 750 | 50 | 76 | 750 | 50 | Off Hire | ||
13 | 323 | 32475 | 200 | 316 | 32475 | 195 | 7 | 0 | 5 | 7 | 0 | 5 | Full Fee | ||
14 | 316 | 32475 | 195 | 814 | 32475 | 192 | 1 | 0 | 3 | 1 | 0 | 3 | Off Hire | ||
15 | 499 | 0 | 0 | 0 | Bunkered | ||||||||||
16 | 814 | 32475 | 192 | 795 | 32475 | 188 | 19 | 0 | 124 | 19 | 0 | 124 | Full Fee | ||
17 | 120 | 0 | 0 | 0 | Bunkered | ||||||||||
18 | 795 | 32475 | 288 | 715 | 31295 | 350 | 80 | 1180 | 58 | 80 | 1180 | 58 | Off Hire | ||
19 | 120 | 0 | 0 | 0 | Bunkered | ||||||||||
20 | 0 | 0 | 0 | Full Fee | |||||||||||
21 | 0 | 0 | 0 | WOW | |||||||||||
22 | 0 | 0 | 0 | Full Fee | |||||||||||
23 | 0 | 0 | 0 | WOW | |||||||||||
24 | 715 | 31295 | 350 | 687 | 31295 | 320 | 28 | 0 | 30 | 28 | 0 | 30 | Full Fee | ||
25 | 687 | 31295 | 320 | 667 | 31295 | 320 | 20 | 0 | 0 | 20 | 0 | 0 | Off Hire | ||
26 | 667 | 31295 | 307 | 666 | 31295 | 307 | 1 | 0 | 0 | 1 | 0 | 0 | Full Fee | ||
27 | 666 | 31295 | 307 | 656 | 31145 | 300 | 10 | 150 | 7 | 10 | 150 | 7 | Off Hire | ||
28 | 656 | 31145 | 300 | 654 | 31145 | 299 | 2 | 0 | 1 | 2 | 0 | 1 | Full Fee | ||
29 | 654 | 31145 | 299 | 654 | 31145 | 299 | Off Hire | ||||||||
30 | 0 | 0 | 0 | Full Fee | |||||||||||
31 | 0 | 0 | 0 | WOW | |||||||||||
32 | 0 | 0 | 0 | Full Fee | |||||||||||
33 | 0 | 0 | 0 | WOW | |||||||||||
Tracker |
Cell Formulas | ||
---|---|---|
Range | Formula | |
M7 | =IF($S7="Bunkered",0,IF($S8="Bunkered",(D7+D8)-J7,D7-J7)) | |
N7 | =IF($S7="Bunkered",0,IF($S8="Bunkered",(E7+E8)-K7,E7-K7)) | |
O7 | =IF($S7="Bunkered",0,IF($S8="Bunkered",(F7+F8)-L7,F7-L7)) | |
P7 | =IF(J7=0,"",M7) | |
Q7 | =IF(K7=0,"",N7) | |
R7 | =IF(L7=0,"",O7) |
Last edited by a moderator: