Change cell colour based on multiple values

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
377
Office Version
  1. 365
Platform
  1. Windows
Hello peeps,

I am trying to change a cell colour if certain text is not selected from DDLs.

So, I have one DDL in A1 and another, different, one in B1. If option "S188" is selected in B1, but either "MDS" or "UR" is not selected in A1 then change cell colour. And if "S193" is selected in B1 but "MDS" is not selected in A1, then change cell colour also.

I'm sure these would only be two conditional format rules (one for "S188" and one for "S193") and I have tried several OR and AND statements but nothing is working. My picklist in A1 is quite long, so I don't want to apply a conditional format for everything but the options as above.

Hope this makes sense for a Friday afternoon!!

Any help would be appreciated, thank you :)
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try:

1) Select cell C1 (or whichever cell you want the conditional formatting to apply to)

2) Enter Conditional formatting rule 1 --> Use a formula to determine which cells to format --> use this as the "format values where this formula is true":
Code:
=AND(B1="S188",A1<>"MDS",A1<>"UR")
apply desired formatting

Conditional formatting rule 2--> Use a formula to determine which cells to format --> use this as the "format values where this formula is true":
Code:
=AND(B1="S193",A1<>"MDS")
apply desired formatting
 
Upvote 0
try this:
Mr Excel Questions 73.xlsm
AB
1
2NOT MDS or URS188
3NOT MDSS193
4MDSS188
5URS188
6MDSS188
7MDSDIFFERENT
8MDSS188
9URS188
10MDS
11S188
12OTHERDIFFERENT
SaraWitch
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A12Expression=AND(B2="S193",B2<>"MDS")textNO
A2:A12Expression=AND(B2="S188",OR(A2="MDS",A2="UR")=FALSE)textNO
 
Upvote 0
Solution
Thank you, @Oaktree - that works the other way round. @awoohaw's solution is spot on!! Thank you so very much! :biggrin:

Enjoy the weekend, both :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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