Use conditional formatting (format > conditional formatting) but change the
first drop-down to read 'Formula Is' (instead of 'Cell Value Is'). Then
create a formula that returns TRUE when you want the format applied, ex:
=b1=2 would set the format (in the cell in which you apply the conditional
format) when the value in cell B2 is 2.