Conditonal formatting

lefty78312

Active Member
Joined
Oct 25, 2007
Messages
275
I'm looking for a formula to use with conditional formatting that highlights cells if any of more than 3 conditions is met. I saw it on this forum before, but I can't find it with a search. It was something like <code>=or(condition1),or(condition2)</code>, etc. Can anyone help me with this?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I'm looking for a formula to use with conditional formatting that highlights cells if any of more than 3 conditions is met. I saw it on this forum before, but I can't find it with a search. It was something like <code>=or(condition1),or(condition2)</code>, etc. Can anyone help me with this?
If you just want the one colour if any of the conditions are met, you just need in the CF 'Formula is' section...
=OR(condition1, condition2, condition3,...)

If you need more specific help, tell us about the required conditions and the range it is to be applied to.
 
Upvote 0
Thank you Ralph and Peter. The <code>=Or</code> solution is the one I had seen previously, and that's the one I was looking for. Although I will try the other one as well.

Just for chuckles, what would be the syntax for a CF that required two or more conditions to be met?
 
Last edited:
Upvote 0
Thank you again, Peter. I just got home and tried the formula you posted yesterday, and it don't work. My worksheet needs to show if the value in the cells is equal to or greater than 2.0GB. and here's the trick: <u>I have to make the 'GB' part of the cell contents.</u> The cell values are specific, known in advance responses that I enter into the formula. If they change, which they might occasionally, I just change the formula. Here's what I have: <code>=OR(2GB,2.5GB,3GB,3.3GB)</code>. Excel immediately returns the message 'The formula you typed contains an error' and changes the formula to something that doesn't work. Where am I going wrong?
 
Upvote 0
Thank you again, Peter. I just got home and tried the formula you posted yesterday, and it don't work. My worksheet needs to show if the value in the cells is equal to or greater than 2.0GB. and here's the trick: <u>I have to make the 'GB' part of the cell contents.</u> The cell values are specific, known in advance responses that I enter into the formula. If they change, which they might occasionally, I just change the formula. Here's what I have: <code>=OR(2GB,2.5GB,3GB,3.3GB)</code>. Excel immediately returns the message 'The formula you typed contains an error' and changes the formula to something that doesn't work. Where am I going wrong?
Two things...

1. You have to say which cell has to = 2GB etc, and

2. I assume the 2GB is a text value so it will need "" around it in the formula.

So, assuming the value is in cell A1 and also it is A1 that you want to conditionally format, the formula you would need in the CF for cell A1 would be:
=OR(A1="2GB",A1="2.5GB",A1="3GB",A1="3.3GB")
 
Upvote 0
Two things...

1. You have to say which cell has to = 2GB etc, and

2. I assume the 2GB is a text value so it will need "" around it in the formula.

So, assuming the value is in cell A1 and also it is A1 that you want to conditionally format, the formula you would need in the CF for cell A1 would be:
=OR(A1="2GB",A1="2.5GB",A1="3GB",A1="3.3GB")

First of all, thank you for your patience in hanging in there with me. I forgot to tell you; there are actually several cells in the column that the info may appear in. Specifically, it appears in e2, e4 and e6. I ended up modifying the formula you suggested <code>=OR(E2,E4,E6="2.0GB",E2,E4,E6="2.5GB",E2,E4,E6="3.0GB".E2,E4,E6="3.3GB")</code>. Again, many thanks for your assistance. You've not only helped me solve my little problem; I learned something.
 
Upvote 0
Just a suggestion. You can custom format your cells of interest
Code:
General "GB"
Now you can just enter the numbers and the GB will be displayed, though the cell will still be a number.

lenze
 
Upvote 0
I ended up modifying the formula you suggested =OR(E2,E4,E6="2.0GB",E2,E4,E6="2.5GB",E2,E4,E6="3.0GB".E2,E4,E6="3.3GB")
Unless I have misunderstood your requirement, I don't believe that formula will do what you want. First, let's assume the red dot I have highlighted was a typo and should have been a comma.

This CF formula (if applied in cell E2) would format E2 if

- E2 contains any number except 0 (see Example 1), or

- E4 contains any number except 0, even if E2 contains something you are not interested in (see Example 2), or

- E6 contains one of the three "GB" text entries, even if E2 contains something you are not interested in (see Example 3)

Note that I have only applied Conditional Formatting to 1 cell (E2) but, as I interpret what you want, I don't think any of those three results are what you want.

Excel Workbook
E
1
2275.68
3
4
5
6
Example 1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E21. / Formula is =OR(E2,E4,E6="2.0GB",E2,E4,E6="2.5GB",E2,E4,E6="3.0GB",E2,E4,E6="3.3GB")Abc



Excel Workbook
E
1
2xyz
3
45000
5
6
Example 2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E21. / Formula is =OR(E2,E4,E6="2.0GB",E2,E4,E6="2.5GB",E2,E4,E6="3.0GB",E2,E4,E6="3.3GB")Abc




Excel Workbook
E
1
2xyz
3
4
5
63.0GB
Example 3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E21. / Formula is =OR(E2,E4,E6="2.0GB",E2,E4,E6="2.5GB",E2,E4,E6="3.0GB",E2,E4,E6="3.3GB")Abc
 
Upvote 0

Forum statistics

Threads
1,214,568
Messages
6,120,278
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top