Suppose the teacher's name area in your invigilation arrangement is A2:H40.
Starting with A2, select A2:H40.
Conditional Formatting
Use the formula to determine the cell to set.
Conditional formula
=a2=$K$ 1
Also set the cell fill shading.
Do it.