Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
Hello Excel friends,
I am struggling to find the logic for what I need to do, and hope someone can help nudge me towards a solution. If I can figure out the approach, I can start to figure out code, but I have no idea even where to start. I have the activity times - which are dynamic variables and a staff schedule, also dynamic, in a range on a worksheet.
I have an activity defined by a start time and and end time. Suppose for the purpose of discussion the start time is 8:00A and the end time is 11:00P. It takes place at centre "BP"
I have a roster of staff scheduled to work at different shifts throughout the day, at different centres of the course of the day.
What I need to do is assign one or more staff to ensure that the activity period is covered by at least one staff person working.
So, if we consider the following roster ....
Ideally, the whole activty would be ideally covered by staff working at that centre (BP), so first choices are staff BPE and BPL.
So, the solution I am trying to figure out would determine that BPE1 could cover from 8:00A - 3:00P, then BPL1 would take 3:00P - 9:00P and the remainder by CUL1. Ideally, I'd prefer the crews to cover the 50% of the two overlap, so like this ...
BPE1 and BPL1 overlap 2:00P - 3:00P, and BPL1 and CUL1 overlap 4:00P - 10:00P so BPE1 would cover 8:00A - 2:30P, BPL1 2:30 - 7:00P, and CUL1 7:00P - 11:00P.
Now suppose, any one of those shifts wasn't there. Lets take out BPE1 out of the schedule. This would leave the activity unstaffed between 8:00A and 2:00P when BPL1 starts. So, we would find the next eligible (trained for that centre) staff available. This list of alternates is available in range on worksheet "lists2".
From the corresponding column represented by the centre, BP in our case (column AH), we would choose the next available "shift" in the series of cells from the remainder of values in that column. So, in this case, RP would be checked from the staff schedule if they would be available. RPE1 is scheduled 7:00A - 3:00P, so they could fill this vacant span. If RPE wasn't available, HPE1 working 7:00A - 3:00P could.
So, in this second example, the solution would look like:
RPE1 and BPL1 overlap 2:00P - 3:00P, and BPL1 and CUL1 overlap 4:00P - 10:00P so RPE1 would cover 8:00A - 2:30P, BPL1 2:30 - 7:00P, and CUL1 7:00P - 11:00P.
If we consider an activity period of 9:00A - 12:00P at HP, the solution would be:
HPE1 would cover 9:00A - 12:00P solely.
If we consider an activity period of 2:00P - 7:00P at WP, the solution would be:
WPE1 would cover 2:00P - 2:30P and WPL would cover 2:30P - 7:00P. Although, since WPL1 is scheduled 1:00P - 9:00P, it would be nice if the logic could reflect its more logical for them to do the whole thing (we can say an hour).
I hope I'm not asking a lot, it has become a hurdle which has consumed a lot of my time.
I am struggling to find the logic for what I need to do, and hope someone can help nudge me towards a solution. If I can figure out the approach, I can start to figure out code, but I have no idea even where to start. I have the activity times - which are dynamic variables and a staff schedule, also dynamic, in a range on a worksheet.
I have an activity defined by a start time and and end time. Suppose for the purpose of discussion the start time is 8:00A and the end time is 11:00P. It takes place at centre "BP"
I have a roster of staff scheduled to work at different shifts throughout the day, at different centres of the course of the day.
What I need to do is assign one or more staff to ensure that the activity period is covered by at least one staff person working.
So, if we consider the following roster ....
wsop 22.0416.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | BPE1 | 7:00A | 3:00P | BPC | Vacancy | ||
2 | BPL1 | 2:00P | 10:00P | BPB | Max | ||
3 | HPE1 | 7:00A | 3:00P | HPC | Anastasia | ||
4 | HPL1 | 2:00P | 10:00P | HPB | Sarah | ||
5 | RPE1 | 7:00A | 3:00P | RPC | Emily | ||
6 | RPL1 | 2:00P | 10:00P | RPB | Chris C. | ||
7 | WPE1 | 7:00A | 3:00P | WPC | Julianna | ||
8 | WPL1 | 2:00P | 10:00P | WPB | Brooke | ||
9 | CUE1 | 7:00A | 3:00P | CUA | Vacancy | ||
10 | CUL1 | 4:00P | 12:00A | CUB | Vacancy | ||
11 | EVE1 | 7:00A | 3:00P | CUE | Vacancy | ||
Sheet3 |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
C5,C8 | List | =nr_dsr2 |
Ideally, the whole activty would be ideally covered by staff working at that centre (BP), so first choices are staff BPE and BPL.
So, the solution I am trying to figure out would determine that BPE1 could cover from 8:00A - 3:00P, then BPL1 would take 3:00P - 9:00P and the remainder by CUL1. Ideally, I'd prefer the crews to cover the 50% of the two overlap, so like this ...
BPE1 and BPL1 overlap 2:00P - 3:00P, and BPL1 and CUL1 overlap 4:00P - 10:00P so BPE1 would cover 8:00A - 2:30P, BPL1 2:30 - 7:00P, and CUL1 7:00P - 11:00P.
Now suppose, any one of those shifts wasn't there. Lets take out BPE1 out of the schedule. This would leave the activity unstaffed between 8:00A and 2:00P when BPL1 starts. So, we would find the next eligible (trained for that centre) staff available. This list of alternates is available in range on worksheet "lists2".
wsop 22.0416.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
AG | AH | AI | AJ | AK | AL | |||
3 | CUE1 | BP | HP | RP | WP | SE | ||
4 | CUE2 | RP | BP | BP | CU | CU | ||
5 | CUL | HP | RP | HP | ||||
6 | WP | WP | WP | |||||
7 | CU | CU | CU | |||||
LISTS2 |
From the corresponding column represented by the centre, BP in our case (column AH), we would choose the next available "shift" in the series of cells from the remainder of values in that column. So, in this case, RP would be checked from the staff schedule if they would be available. RPE1 is scheduled 7:00A - 3:00P, so they could fill this vacant span. If RPE wasn't available, HPE1 working 7:00A - 3:00P could.
So, in this second example, the solution would look like:
RPE1 and BPL1 overlap 2:00P - 3:00P, and BPL1 and CUL1 overlap 4:00P - 10:00P so RPE1 would cover 8:00A - 2:30P, BPL1 2:30 - 7:00P, and CUL1 7:00P - 11:00P.
If we consider an activity period of 9:00A - 12:00P at HP, the solution would be:
HPE1 would cover 9:00A - 12:00P solely.
If we consider an activity period of 2:00P - 7:00P at WP, the solution would be:
WPE1 would cover 2:00P - 2:30P and WPL would cover 2:30P - 7:00P. Although, since WPL1 is scheduled 1:00P - 9:00P, it would be nice if the logic could reflect its more logical for them to do the whole thing (we can say an hour).
I hope I'm not asking a lot, it has become a hurdle which has consumed a lot of my time.