Ask LibreOffice - RSS feedhttps://ask.libreoffice.org/en/questions/Questions and answers for LibreOfficeenThu, 30 Jan 2020 19:25:08 +0100"OR" in conditional formatting formulahttps://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/ Greetings,
I want to update the conditional formatting in my SS by adding an alternative cell value to an existing condition - e.g that if the input is either "1" OR "2" then the output is the same.
In the present case I have:
Condition 1
Formula is $D3="IND" ( which determines that the output number is fixed to two decimal places)
I had thought that as I want the same condition to be applied to a different value in the same cell then I could use the "OR" operator in a formula rather than add a new condition. I have tried varying combinations and placement of "OR" but this doesn't work and instead messes up the formatting for the first value "IND". As I have a fair number of similar additions I would like to avoid having to duplicate all the conditions but it's not a major pain if it's not feasable.
Any help would be much appreciated
Wed, 29 Jan 2020 15:04:38 +0100https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/Comment by m.a.riosv for <p>Greetings,</p>
<p>I want to update the conditional formatting in my SS by adding an alternative cell value to an existing condition - e.g that if the input is either "1" OR "2" then the output is the same.</p>
<p>In the present case I have:
Condition 1
Formula is $D3="IND" ( which determines that the output number is fixed to two decimal places)</p>
<p>I had thought that as I want the same condition to be applied to a different value in the same cell then I could use the "OR" operator in a formula rather than add a new condition. I have tried varying combinations and placement of "OR" but this doesn't work and instead messes up the formatting for the first value "IND". As I have a fair number of similar additions I would like to avoid having to duplicate all the conditions but it's not a major pain if it's not feasable.</p>
<p>Any help would be much appreciated</p>
https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227134#post-id-227134Please attach a sample file editing your question.Wed, 29 Jan 2020 22:45:03 +0100https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227134#post-id-227134Comment by Opaque for <p>Greetings,</p>
<p>I want to update the conditional formatting in my SS by adding an alternative cell value to an existing condition - e.g that if the input is either "1" OR "2" then the output is the same.</p>
<p>In the present case I have:
Condition 1
Formula is $D3="IND" ( which determines that the output number is fixed to two decimal places)</p>
<p>I had thought that as I want the same condition to be applied to a different value in the same cell then I could use the "OR" operator in a formula rather than add a new condition. I have tried varying combinations and placement of "OR" but this doesn't work and instead messes up the formatting for the first value "IND". As I have a fair number of similar additions I would like to avoid having to duplicate all the conditions but it's not a major pain if it's not feasable.</p>
<p>Any help would be much appreciated</p>
https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227112#post-id-227112I have tested my proposal before posting (and of course it worked for me). So now it is time to upload an anonymized sample file, to find out why it doesn't work for you.Wed, 29 Jan 2020 20:07:44 +0100https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227112#post-id-227112Comment by Cantagril for <p>Greetings,</p>
<p>I want to update the conditional formatting in my SS by adding an alternative cell value to an existing condition - e.g that if the input is either "1" OR "2" then the output is the same.</p>
<p>In the present case I have:
Condition 1
Formula is $D3="IND" ( which determines that the output number is fixed to two decimal places)</p>
<p>I had thought that as I want the same condition to be applied to a different value in the same cell then I could use the "OR" operator in a formula rather than add a new condition. I have tried varying combinations and placement of "OR" but this doesn't work and instead messes up the formatting for the first value "IND". As I have a fair number of similar additions I would like to avoid having to duplicate all the conditions but it's not a major pain if it's not feasable.</p>
<p>Any help would be much appreciated</p>
https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227100#post-id-227100You are of course right.
I have tried what I understand to be the principal possibilites starting with the one you mention - which I believed should work but doesn't. The other two were out of desperation :-)
1. OR($D3="IND";$D3="SHA")
2. OR($D3="IND",$D3="SHA")
3. ($D3="IND") OR ($D3="SHA")Wed, 29 Jan 2020 16:55:18 +0100https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227100#post-id-227100Comment by Opaque for <p>Greetings,</p>
<p>I want to update the conditional formatting in my SS by adding an alternative cell value to an existing condition - e.g that if the input is either "1" OR "2" then the output is the same.</p>
<p>In the present case I have:
Condition 1
Formula is $D3="IND" ( which determines that the output number is fixed to two decimal places)</p>
<p>I had thought that as I want the same condition to be applied to a different value in the same cell then I could use the "OR" operator in a formula rather than add a new condition. I have tried varying combinations and placement of "OR" but this doesn't work and instead messes up the formatting for the first value "IND". As I have a fair number of similar additions I would like to avoid having to duplicate all the conditions but it's not a major pain if it's not feasable.</p>
<p>Any help would be much appreciated</p>
https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227077#post-id-227077Without mentioning what you tried nobody could tell where you failed, but
`OR($D3="IND";$D3="<someothervalue>")`
should do the job.Wed, 29 Jan 2020 15:21:29 +0100https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?comment=227077#post-id-227077Answer by Cantagril for <p>Greetings,</p>
<p>I want to update the conditional formatting in my SS by adding an alternative cell value to an existing condition - e.g that if the input is either "1" OR "2" then the output is the same.</p>
<p>In the present case I have:
Condition 1
Formula is $D3="IND" ( which determines that the output number is fixed to two decimal places)</p>
<p>I had thought that as I want the same condition to be applied to a different value in the same cell then I could use the "OR" operator in a formula rather than add a new condition. I have tried varying combinations and placement of "OR" but this doesn't work and instead messes up the formatting for the first value "IND". As I have a fair number of similar additions I would like to avoid having to duplicate all the conditions but it's not a major pain if it's not feasable.</p>
<p>Any help would be much appreciated</p>
https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?answer=227250#post-id-227250I'm not sure quite why but once again, the culprit appoears to have been to do with Direct Formatting as my original formula (and Opaque's answer) are now working. I had an identical problem some months ago (see my question "Conditional Formatting problem after update") with the same solution, i.e clear direct formatting and then reinstate.
Once again, Many thanks Opaque!Thu, 30 Jan 2020 19:25:08 +0100https://ask.libreoffice.org/en/question/227071/or-in-conditional-formatting-formula/?answer=227250#post-id-227250