Conditional Formatting Assistance

Disarmonious

Board Regular
Joined
Oct 31, 2016
Messages
144
I have two cells, A1 and B1, and I want the text in cell B1 to turn red if "A1=Apple" or "A1=Orange" or "A1=Banana" AND "B1=Pink" or "B1=Purple" or "B1=Blue"

I'm looking for the shortest formula to make this work because I want to avoid doing it the long way by entering a bunch of AND formulas that would turn the text in cell B1 to red.

Thank you in advance!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
This is probably the shortest you're going to get:

Excel Formula:
=AND(OR(A1="Apple",A1="Orange",A1="Banana"),OR(B1="Pink",B1="Purple",B1="Blue"))
 
Upvote 0
This is probably the shortest you're going to get:

Excel Formula:
=AND(OR(A1="Apple",A1="Orange",A1="Banana"),OR(B1="Pink",B1="Purple",B1="Blue"))
However, you could use a lookup table if you have many possible values:
Book1
ABCDEFGH
1ApplePinkTRUEApplePink
2OrangePinkTRUEOrangePurple
3BananaYellowFALSEBananaBlue
4ApplePurpleTRUE
5PearPurpleFALSE
6BananaPurpleTRUE
7AppleGreenFALSE
8OrangeBlueTRUE
9BananaBlueTRUE
Sheet1
Cell Formulas
RangeFormula
C1:C9C1=AND(ISNUMBER(MATCH(A1,$G$1:$G$3,0)),ISNUMBER(MATCH(B1,$H$1:$H$3,0)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:C9Expression=AND(ISNUMBER(MATCH(A1,$G$1:$G$3,0)),ISNUMBER(MATCH(B1,$H$1:$H$3,0)))textNO
B1:B9Expression=AND(OR(A1="Apple",A1="Orange",A1="Banana"),OR(B1="Pink",B1="Purple",B1="Blue"))textNO
 
Upvote 0
Amazing! Thank you for your expertise! I appreciate you taking the time to assist me with this inquiry! I will attempt both recommendations to see which would be a better fit!
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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