I Have been away from using excel / vba for quite some time, and would really appreciate some assistance from my old friends at the Mr Excel community.
I am looking to run a vba code to output some data from a large spreadsheet based on date, sitename, and a textstring lookup.
The basics are: from the source sheet I need to summarise the sum of the values in column W "post duration" based on all entries by date, per site (based on the last 4 characters of the text string in column R "post name").
And finally to sum any entries (By date) that have the term "SUB" (Including any variation of the term. e.g. "SUBS") in column B "Employee ID"
Source data is as below:
Output data I am looking achieve:
Any assistance gratefully received
I am looking to run a vba code to output some data from a large spreadsheet based on date, sitename, and a textstring lookup.
The basics are: from the source sheet I need to summarise the sum of the values in column W "post duration" based on all entries by date, per site (based on the last 4 characters of the text string in column R "post name").
And finally to sum any entries (By date) that have the term "SUB" (Including any variation of the term. e.g. "SUBS") in column B "Employee ID"
Source data is as below:
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
3 | A | B | R | W | ||
4 | Date | Employee ID | Post's name | Post's duration | ||
5 | 05/08/2018 | SUB6 | SO DBT1 | 12 | ||
6 | 05/08/2018 | SUB1 | SO EDI4 | 12 | ||
7 | 05/08/2018 | SUB2 | SO EDI4 | 12 | ||
8 | 05/08/2018 | SUB3 | SO EDI4 | 12 | ||
9 | 05/08/2018 | SUB4 | SO EDI4 | 12 | ||
10 | 05/08/2018 | 28223 | SO GLA1 | 12 | ||
11 | 06/08/2018 | 28458 | SO DBT1 | 12 | ||
12 | 06/08/2018 | SUB6 | SO DBT1 | 12 | ||
13 | 06/08/2018 | SUB1 | SO EDI4 | 10.5 | ||
Sheet2 |
Output data I am looking achieve:
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Output | |||||
2 | Date | Site | Hours | Sub hours | ||
3 | Multiple occasions of date (Column A) | Based on cell values (Text string) last 4 characters end with site code | Sum of column W based on Date and site | Hour where text in column employee ID include the text "SUB" | ||
4 | ||||||
5 | Example output | |||||
6 | 01/02/2019 | EDI4 | 225.5 | 48 | ||
Sheet1 |
Any assistance gratefully received