Multi conditional formatting on same cells

Is it possible in to use conditional formatting on the same cells to switch on/off different cell attributes?
This was possible under Excel.

eg:
A1 = “Hello World” default attributes black text, no background colour.

conditions are:

if B1=“x” then A1 Yellow background else no background

if C1=“x” then A1 Red text else black text

if D1=“x” then A1 Bold else not Bold

Conditional formatting in Calc doesn’t switch on/off cell attributes, but overaly respective settings assigned to cell styles.

As the CF editor clearly shows, you can define many conditions and associate them with different cell styles. The first condition coming out TRUE will end the testing.

The more recently implemented toys of the “All Cells” mode aren’t actually CF in the sense used above.

@Unknown, To work it is necessary to see the three cells (B1, C1, D1) at the same time.

See an attached suggestion.

8 combinations are required in 3 on / off fields.

8 styles were created.

image description


ATTENTION: If you would like to give more details to your question, use edit in question or add a comment below. Thank you.

If the answer met your need, please click on the ball Descrição da imagem to the left of the answer, to finish the question.

You can also use the STYLE function.

To test duplicate the spreadsheet, from the example, and paste the formula in A1.

=IF(AND(B1="";C1="";D1="");"Hello Wold"&T(STYLE("000"));IF(AND(B1="";C1="";D1="x");"Hello Wold"&T(STYLE("001"));IF(AND(B1="";C1="x";D1="");"Hello Wold"&T(STYLE("010"));IF(AND(B1="";C1="x";D1="x");"Hello Wold"&T(STYLE("011"));IF(AND(B1="x";C1="";D1="");"Hello Wold"&T(STYLE("100"));IF(AND(B1="x";C1="";D1="x");"Hello Wold"&T(STYLE("101"));IF(AND(B1="x";C1="x";D1="");"Hello Wold"&T(STYLE("110"));IF(AND(B1="x";C1="x";D1="x");"Hello Wold"&T(STYLE("111"));"ff"))))))))

My real problem was when I converted all my financial Excel (XL) documents to LibreOffice (LO) documents.

I wanted to null out 0.00 lines by making the text white. Highlight the line of data where money hadn’t yet cleared in the banks (Red Text) and highlight lines where items hadn’t yet been recieved (Pink Background).

All the Conditional Formatting (CF) was either not working or making strange alterations to entries ie. All my “Dates” where changing from “18-Aug-2020” to “44061”.

It became apparant that the CF in LO was unlike CF in XL. In XL you could just select the cell attributes you wanted to change, like Font colour, background Colour or borders etc and not effect any other attributes of the cell. This is something that LO may want to concider implementing in future versions. It would be easier and use less command lines. Like Schiavinatto demonstrated, it now takes 8 lines of command when it would otherwise be 3. If there are 4 conditions then the lines of command would go up to 16.

Thank you Schiavinatto for uploading the file. It allowed me to experiment and learn from the enviroment about LO more. It showed that all the styles in F11 were customised. I was also able to modify and delete your styles, which I wasn’t able to in my converted documents. This showed me that there was not a glitch in the version of LO I was using and I discovered that I had to unprotect ALL the sheets and not just the one I was working in, to modify or delete the styles. I had hundreds of styles in my F11 box. Also thanks for the use of the AND formula. I couldn’t find any help for that online. (Looking in all the wrong places)

Thanks also to Lupp. If you arrange the commands in order of conditions you can eliminate the empty condition. You save 1 line of command and can still change the attritubes of the cells from the active worksheet.