I want to write a statement saying this in column H...

IF A2=ED or 17 then G2<=1,1,0 AND if A2 is not ED or 17 then G2<=3,1,0

Basically...if A2 equals 17 or ED I want column H to look at G2 for 1 or lower and give it a 1 if it is one or lower. If it is 2 or higher then give it a 0.

If A2 is not 17 or ED then I want to use 3 as the criteria for getting a 1 or 0.

Is this possible? If so, what is the formula?