In B2:

=IFERROR(INDEX('CC rota'!$A$1:$X$1,SMALL(IF('CC rota'!$A$2:$A$16=Daily!$A$1,IF('CC rota'!$E$2:$X$16=Daily!B$1,COLUMN('CC rota'!$E$1:$X$1))),ROWS($A$1:A1))),"")

... confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

Once confirmed, copy across and down.