Hi All,
I am stuck with a problem for 2 days and I can not find a solution to it. I am trying to make an employee roster with variable constraints. Each employee will get a rest day after 5 days provided the 6th day is not Friday or Sunday. If the 6th day is Friday or Sunday, the employee gets a day off after 4 days (a day before Friday or Sunday).
=IF(COUNTIF($C$3:C3,"5:15")<4,"5:15",IF(COUNTIF($C$3:C3,"5:15")=4,IF(OR(E2="Friday",E2="Sunday"),"R","5:15"),IF(COUNTIF($C$3:C3,"5:15")=5,IF(OR(E2="Friday",E2="Sunday"),"R","5:15"))))
I have managed to get this far but I need the range to change after "Rest" appears in the schedule. In my current formula, the range keeps expanding from C3 onwards and the numerical counter does not work. Is there a way that I can keep the range variable i.e. If previous cell (G3) = Rest, the range of the formula should change to the Rest cell onwards ($G$3:G3).
Would be really great if someone has some other way to do this as well!
Bookmarks