You can set up conditional formats within cells that determine the formatting of the cell based on the outcome of a conditional operation or rule.
For more information, refer to Using Conditional Formatting in Cells.