If cell = value color BG

Hi all,
Im a noob user of libreoffice so pls be patient.
Situation Cell A1 = value1, Cell B1 = value2, Cell C1 = IF((value2-value1=0),“0”,“X”)
What I would like: if result = 0 "color the baground with green, otherwisw red
I tried with Conditional formatting (I really know it very little) and the max I got was a 0 or a X without any color

Any idea, suggestion?

Thank you in advance
papa

@paparucino: Please click :heavy_check_mark: to mark the answer as correct.

Hello @paparucino,

Please try the following formula in cell C1:

= IF(A1=B1,"0" & T(STYLE("Good")),"X" & T(STYLE("Bad")))

If your locale instead uses the semicolon as argument separator, the formula becomes

= IF(A1=B1;"0" & T(STYLE("Good"));"X" & T(STYLE("Bad")))

HTH, lib

It works. Thank you so much!!!

papa