Look at Format | Conditional Formatting
You can change the fill color, font color and other font characteristics
based on the calculated value in the cell. There are also ways to get it to
change those based on (hard for me to explain) that cell meeting criteria
defined by another formula.
But you can't change the formula in a cell based on the results of a formula
in that same cell.
As I know, there is no formula to change the cell properties (maybe text() to
change value format, but no cell format); there is one to obtain that:
cell().
However, you can change the format of a cell using "Conditional format"
(Tools/Conditional format) where you can define up to three diferent formats
for the same cell based on the value of the cell vÃa core value or a formula.