Sorry for my english.

I tried to realise my task to the following way:
B1=If A8=A9=A10 -> x
C1=If A7=A8=A9=A10 ->y
C4=If A6=A7=A8=A9=A10 ->z

But the formula "IF" doesn't work with 3 and more cells as I know
Please be so kind to advice me which function in more convinient for this.
Thak you