Perhaps some more information would be helpful.
in D7 enter 1
in D8 enter 0
in D9 enter = D7+D8
in D10 I have the formula =IF(D9=1,"x",IF(D9=2,"y","z"))
on this cell I have conditional formatting
Cell Value is equal to "x" and format as required.
Do the same for Y and Z.
Is this any help or have I missed the point completely?