Doylezeebeast
New Member
- Joined
- Nov 19, 2020
- Messages
- 13
- Office Version
- 2016
- Platform
- Windows
Hi,
I have a sheet of data such as the example below for sickness absence data for employees which is in sheet1 of the file
Is it is possible to create some VBA to split this data into individual months so it looks like this, and create this data onto sheet 2, leaving sheet 1 data as is/unchanged:
A couple of things to mention...
In column "Att./abs.days" if this is shown as less than 1 then for column "Calendar days" this should show as "0.00".
For column "Att./abs.days" , the number of days shown here for are the number of working days (Monday to Friday) and based on UK bank holiday. So for example 1/1/20 - 8/1/20 is 5 working days because of bank holiday on 1/1/20
For column "Absence hours" , the absence hours shown should be calculated from the number of "Att./abs.days" column. For example with employee John Carper who has 157.50 absence hours based on 21 days absence = 7.5 hours per day. We can then use this "7.5" value for the calculation of hours in the split output.
I looked at this post as it was helpful but didn't quite go far enough for what i needed:
Thanks for any help I can get on this one
I have a sheet of data such as the example below for sickness absence data for employees which is in sheet1 of the file
Personnel number | Name of Employee or Applicant | Att./Absence type | Att./abs. type text | Desc. of illness | Desc. of illness | Att./abs. days | Absence hours | Calendar days | Start Date | End Date |
9002285 | Ben Cooper | 0220 | *SSP Sickness Abs p100% | G0049 | Sickness/Diarrhoea | 1.00 | 6.00 | 1.00 | 07/11/2019 | 07/11/2019 |
9002362 | Steven Smith | 0220 | *SSP Sickness Abs p100% | G0049 | Cough/Cold/Flu | 0.55 | 4.00 | 0.00 | 10/05/2019 | 10/05/2019 |
9002565 | Matt Damon | 0230 | Sickness Abs paid 100% | G0034 | Cough/Cold/Flu | 0.50 | 3.75 | 0.00 | 07/02/2019 | 07/02/2019 |
9002565 | Matt Damon | 0230 | Sickness Abs paid 100% | G0034 | Cough/Cold/Flu | 1.00 | 7.50 | 1.00 | 08/02/2019 | 08/02/2019 |
9002904 | Stephen Robinson | 0220 | *SSP Sickness Abs p100% | G0049 | Sickness/Diarrhoea | 3.00 | 21.00 | 3.00 | 02/01/2019 | 04/01/2019 |
9002905 | John Carper | 0220 | *SSP Sickness Abs p100% | G0006 | Stress/Depression | 21.00 | 157.50 | 29.00 | 16/07/2019 | 13/08/2019 |
9031129 | Mark Johnson | 0225 | *SSP Sickness Abs p50% | G0012 | Bad Back | 63.00 | 567.00 | 92.00 | 09/10/2019 | 08/01/2020 |
Is it is possible to create some VBA to split this data into individual months so it looks like this, and create this data onto sheet 2, leaving sheet 1 data as is/unchanged:
Personnel number | Name of Employee or Applicant | Att./Absence type | Att./abs. type text | Desc. of illness | Desc. of illness | Att./abs. days | Absence hours | Calendar days | Start Date | End Date |
9002285 | Ben Cooper | 0220 | *SSP Sickness Abs p100% | G0049 | Sickness/Diarrhoea | 1.00 | 6.00 | 1.00 | 07/11/2019 | 07/11/2019 |
9002362 | Steven Smith | 0220 | *SSP Sickness Abs p100% | G0049 | Cough/Cold/Flu | 0.55 | 4.00 | 0.00 | 10/05/2019 | 10/05/2019 |
9002565 | Matt Damon | 0230 | Sickness Abs paid 100% | G0034 | Cough/Cold/Flu | 0.50 | 3.75 | 0.00 | 07/02/2019 | 07/02/2019 |
9002565 | Matt Damon | 0230 | Sickness Abs paid 100% | G0034 | Cough/Cold/Flu | 1.00 | 7.50 | 1.00 | 08/02/2019 | 08/02/2019 |
9002904 | Stephen Robinson | 0220 | *SSP Sickness Abs p100% | G0049 | Sickness/Diarrhoea | 3.00 | 21.00 | 3.00 | 02/01/2019 | 04/01/2019 |
9002905 | John Carper | 0220 | *SSP Sickness Abs p100% | G0006 | Stress/Depression | 12.00 | 90.00 | 16.00 | 16/07/2019 | 31/07/2019 |
9002905 | John Carper | 0220 | *SSP Sickness Abs p100% | G0006 | Stress/Depression | 9.00 | 67.50 | 13.00 | 01/08/2019 | 13/08/2019 |
9031129 | Mark Johnson | 0225 | *SSP Sickness Abs p50% | G0012 | Bad Back | 17.00 | 153.00 | 23.00 | 09/10/2019 | 31/10/2019 |
9031129 | Mark Johnson | 0225 | *SSP Sickness Abs p50% | G0012 | Bad Back | 21.00 | 189.00 | 30.00 | 01/11/2019 | 30/11/2019 |
9031129 | Mark Johnson | 0225 | *SSP Sickness Abs p50% | G0012 | Bad Back | 20.00 | 180.00 | 31.00 | 01/12/2019 | 31/12/2019 |
9031129 | Mark Johnson | 0225 | *SSP Sickness Abs p50% | G0012 | Bad Back | 5.00 | 45.00 | 8.00 | 01/01/2020 | 08/01/2020 |
A couple of things to mention...
In column "Att./abs.days" if this is shown as less than 1 then for column "Calendar days" this should show as "0.00".
For column "Att./abs.days" , the number of days shown here for are the number of working days (Monday to Friday) and based on UK bank holiday. So for example 1/1/20 - 8/1/20 is 5 working days because of bank holiday on 1/1/20
For column "Absence hours" , the absence hours shown should be calculated from the number of "Att./abs.days" column. For example with employee John Carper who has 157.50 absence hours based on 21 days absence = 7.5 hours per day. We can then use this "7.5" value for the calculation of hours in the split output.
I looked at this post as it was helpful but didn't quite go far enough for what i needed:
Excel VBA or Formula to Split Period of Months into Individual Month
Hi guys, I have a sheet with data similar to the following table: Name Location Start Date End Date Days John Canada January 1, 2013 February 24, 2013 55 Jack US February 18, 2013 March 23, 2013 34 Is it possible to create an Excel formula or VBA to split this set of...
www.mrexcel.com
Thanks for any help I can get on this one