The Planner
New Member
I have created a shift calendar that calculates in this instance a 14 on 7 off shift rotation with 3 shift groupings. conditional formatting displays the shifts on a perpetual gantt style showing the shifts against the list of employee names.
Conditional formatting works well as long as the first date in the rotation of shift 1 is in the past.
This formula looks through the shift pattern dates using vlookup and named ranges based on the gantt dates and sticks in a corresponding shift number to trigger the formatting.
[pre]
[/pre]
I would like to make this a little more dynamic so that I can alter the shift pattern and its calculations but have the gantt remain stable.
a copy of the file can be found here
https://docs.google.com/file/d/0B93dszGYZ3tjNXJnc0RITzNtd0U/edit?usp=sharing
Conditional formatting works well as long as the first date in the rotation of shift 1 is in the past.
This formula looks through the shift pattern dates using vlookup and named ranges based on the gantt dates and sticks in a corresponding shift number to trigger the formatting.
[pre]
Code:
=IF(AND($H6=1,VLOOKUP(I$3,Ashift,1,TRUE)<=I$3,VLOOKUP(I$3,Ashift,2,TRUE)>=I$3),1,IF(AND($H6=2,VLOOKUP(I$3,Bshift,1,TRUE)<=I$3,VLOOKUP(I$3,Bshift,2,TRUE)>=I$3),2,IF(AND($H6=3,VLOOKUP(I$3,Cshift,1,TRUE)<=I$3,VLOOKUP(I$3,Cshift,2,TRUE)>=I$3),3,"")))
I would like to make this a little more dynamic so that I can alter the shift pattern and its calculations but have the gantt remain stable.
a copy of the file can be found here
https://docs.google.com/file/d/0B93dszGYZ3tjNXJnc0RITzNtd0U/edit?usp=sharing