Hi ezraroellstoa.
You can try out this formula to fill in the shift automatically based on your desired preference:
=IF(OR($D4="",F$3=""), "",IF(E4= "",D4, INDEX(Shift_Legend,IF(MATCH(E4,Shift_Legend,0)+1>COUNTA(Shift_Legend),1,MATCH(E4,Shift_Legend,0)+1))))
For this to work, you need the...