google sheets – team ordering formula

quick ques..we need to schedule multiple teams based off of periods ….pls. refer to My linked Sheet

Col. D has desired results but they work as follows:

Depending on what day it is….formula shd. start that day with per 1 (Col C) choosing the day’s starting team and then follow Team Sequence order given…so keep on rolling all teams in same order for THAT DAY.

Then as new day begins – formula takes that days Start team and then again follow the 7 teams rolling order for that whole day – each day has 24 periods.