bryanrobson
New Member
- Joined
- Aug 19, 2022
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
The attached file is just a sample and the original has much more data but I have deleted rows out of it and also changed some of the data as it is sensitive information.
I need the code to use the start month of the billing period and the end month of the billing period by using the Start sheet and selecting the month from the drop down lists in columns E and G
For some sites there may be more than 1 row. For example, row 35 and 36 and there are others. This is because while we are at the site, we have done 2 jobs or more.
No Visits in column F is the number of visits to that site booked (not necessarily completed yet). But, if a site has more than 1 row for example row 35 and 36, then the number of visits is 3 not 3 + 3.
Then the 1 indicated in cells January to December represent when the work has been booked in and green if it has been completed. Sometimes the work may not get done as the engineer couldnt go, it was cancelled or the engineer arrived on site and couldnt do the work. So these will not be green.
The cells also have comments stating the date when the work was done.
e.g. Clean done 20/04/2022
What I need is to consolidate the data explained above. I need the same column headings on an output sheet. But, firstly, one line only for each site. The value of the number of site visits are not to be added together (just use the number in that cell). Then add up the numbers in January to December only if the cell is green and only if those months fall within the start month and end month selected in the drop down on the Start sheet. Also include the inserted comment eg Clean done 20/04/2022 in a cell.
I have included a sheet called Sample Output. So, basically if the period to be billed is June, July and August then this would be the expected results.
Many thanks in advance
I need the code to use the start month of the billing period and the end month of the billing period by using the Start sheet and selecting the month from the drop down lists in columns E and G
For some sites there may be more than 1 row. For example, row 35 and 36 and there are others. This is because while we are at the site, we have done 2 jobs or more.
No Visits in column F is the number of visits to that site booked (not necessarily completed yet). But, if a site has more than 1 row for example row 35 and 36, then the number of visits is 3 not 3 + 3.
Then the 1 indicated in cells January to December represent when the work has been booked in and green if it has been completed. Sometimes the work may not get done as the engineer couldnt go, it was cancelled or the engineer arrived on site and couldnt do the work. So these will not be green.
The cells also have comments stating the date when the work was done.
e.g. Clean done 20/04/2022
What I need is to consolidate the data explained above. I need the same column headings on an output sheet. But, firstly, one line only for each site. The value of the number of site visits are not to be added together (just use the number in that cell). Then add up the numbers in January to December only if the cell is green and only if those months fall within the start month and end month selected in the drop down on the Start sheet. Also include the inserted comment eg Clean done 20/04/2022 in a cell.
I have included a sheet called Sample Output. So, basically if the period to be billed is June, July and August then this would be the expected results.
Many thanks in advance
test.xlsm | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | |||
1 | Company Report | |||||||||||||||||||
2 | Site Visits | |||||||||||||||||||
3 | ||||||||||||||||||||
4 | ||||||||||||||||||||
5 | Head Office | Site No | Site Name | Site Address | Engineers Name | No Visits | January | February | March | April | May | June | July | August | September | October | November | December | ||
6 | Head Office A | 956 | Site A | Site Address Site A | Engineer A | 3 | 1 | 1 | 1 | |||||||||||
7 | Head Office A | 956 | Site A | Site Address Site A | Engineer A | 3 | 1 | 1 | 1 | |||||||||||
8 | Head Office A | 956 | Site A | Site Address Site A | Engineer A | 3 | 1 | 1 | 1 | |||||||||||
9 | Head Office A | 956 | Site A | Site Address Site A | Engineer A | 3 | 1 | 1 | 1 | |||||||||||
10 | Head Office A | 1082 | Site B | Site Address Site B | Engineer F | 3 | 1 | 1 | 1 | |||||||||||
11 | Head Office A | 1408 | Site C | Site Address Site C | Engineer B | 3 | 1 | 1 | 1 | |||||||||||
12 | Head Office A | 1453 | Site D | Site Address Site D | Engineer P | 3 | 1 | 1 | 1 | |||||||||||
13 | Head Office A | 1453 | Site D | Site Address Site D | Engineer P | 3 | 1 | 1 | 1 | |||||||||||
14 | Head Office A | 1464 | Site E | Site Address Site E | Engineer H | 3 | 1 | 1 | 1 | |||||||||||
15 | Head Office A | 1466 | Site F | Site Address Site F | Engineer L | 3 | 1 | 1 | 1 | |||||||||||
16 | Head Office A | 1489 | Site G | Site Address Site G | Engineer T | 3 | 1 | 1 | 1 | |||||||||||
17 | Head Office A | 1490 | Site H | Site Address Site H | Engineer O | 3 | 1 | 1 | 1 | |||||||||||
18 | Head Office A | 1782 | Site I | Site Address Site I | Engineer S | 3 | 1 | 1 | 1 | |||||||||||
19 | Head Office A | 1866 | Site J | Site Address Site J | Engineer E | 3 | 1 | 1 | 1 | |||||||||||
20 | Head Office A | 1978 | Site K | Site Address Site K | Engineer K | 3 | 1 | 1 | 1 | |||||||||||
21 | Head Office A | 1981 | Site L | Site Address Site L | Engineer V | 3 | 1 | 1 | 1 | |||||||||||
22 | Head Office A | 2016 | Site M | Site Address Site M | Engineer L | 3 | 1 | 1 | 1 | |||||||||||
23 | Head Office A | 3639 | Site N | Site Address Site N | Engineer F | 3 | 1 | 1 | 1 | |||||||||||
24 | Head Office A | 3769 | Site O | Site Address Site O | Engineer L | 3 | 1 | 1 | 1 | |||||||||||
25 | Head Office A | 4453 | Site P | Site Address Site P | Engineer C | 3 | 1 | 1 | 1 | |||||||||||
26 | Head Office A | 4998 | Site Q | Site Address Site Q | Engineer S | 3 | 1 | 1 | 1 | |||||||||||
27 | Head Office A | 9662 | Site R | Site Address Site R | Engineer R | 3 | 1 | 1 | 1 | |||||||||||
28 | Head Office B | 249 | Site S | Site Address Site S | Engineer D | 3 | 1 | 1 | 1 | |||||||||||
29 | Head Office B | 347 | Site T | Site Address Site T | Engineer S | 3 | 1 | 1 | 1 | |||||||||||
30 | Head Office B | 494 | Site U | Site Address Site U | Engineer K | 3 | 1 | 1 | 1 | |||||||||||
31 | Head Office B | 612 | Site V | Site Address Site V | Engineer D | 3 | 1 | 1 | 1 | |||||||||||
32 | Head Office B | 820 | Site W | Site Address Site W | Engineer K | 3 | 1 | 1 | 1 | |||||||||||
33 | Head Office B | 822 | Site X | Site Address Site X | Engineer F | 3 | 1 | 1 | 1 | |||||||||||
34 | Head Office B | 824 | Site Y | Site Address Site Y | Engineer W | 3 | 1 | 1 | 1 | |||||||||||
35 | Head Office B | 832 | Site Z | Site Address Site Z | Engineer M | 3 | 1 | 1 | 1 | |||||||||||
36 | Head Office B | 845 | Site AA | Site Address Site AA | Engineer L | 3 | 1 | 1 | 1 | |||||||||||
37 | Head Office B | 852 | Site AB | Site Address Site AB | Engineer S | 3 | 1 | 1 | 1 | |||||||||||
38 | Head Office B | 867 | Site AC | Site Address Site AC | Engineer U | 3 | 1 | 1 | 1 | |||||||||||
39 | Head Office B | 867 | Site AC | Site Address Site AC | Engineer U | 3 | 1 | 1 | 1 | |||||||||||
40 | Head Office B | 892 | Site AD | Site Address Site AD | Engineer P | 3 | 1 | 1 | 1 | |||||||||||
41 | Head Office B | 988 | Site AE | Site Address Site AE | Engineer G | 3 | 1 | 1 | 1 | |||||||||||
42 | Head Office B | 1114 | Site AF | Site Address Site AF | Engineer T | 3 | 1 | 1 | 1 | |||||||||||
43 | Head Office B | 1130 | Site AG | Site Address Site AG | Engineer E | 3 | 1 | 1 | 1 | |||||||||||
44 | Head Office B | 1227 | Site AH | Site Address Site AH | Engineer M | 3 | 1 | 1 | 1 | |||||||||||
45 | Head Office B | 1735 | Site AI | Site Address Site AI | Engineer T | 3 | 1 | 1 | 1 | |||||||||||
46 | Head Office B | 1765 | Site AJ | Site Address Site AJ | Engineer S | 3 | 1 | 1 | 1 | |||||||||||
47 | Head Office B | 1765 | Site AJ | Site Address Site AJ | Engineer S | 3 | 1 | 1 | 1 | |||||||||||
48 | Head Office B | 2000 | Site AK | Site Address Site AK | Engineer F | 3 | 1 | 1 | 1 | |||||||||||
49 | Head Office B | 2081 | Site AL | Site Address Site AL | Engineer A | 3 | 1 | 1 | 1 | |||||||||||
50 | Head Office B | 2097 | Site AM | Site Address Site AM | Engineer T | 3 | 1 | 1 | 1 | |||||||||||
Data |