Conditional formatting using Or formula

Alpacino

Well-known Member
Joined
Mar 16, 2011
Messages
511
Hi peeps,

Just a quick one how do I write a formula in conditional formatting using OR.
I would like the cell interior to be Green if value = H or = AH or = PH

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You could conditionaly format A1 with a formula like
=OR(A1="H",A1="AH",A1="PH")
or
=ISNUMBER(MATCH(A1, {"H","AH","PH"}, 0))
 
Upvote 0
Select all the cells, then set the CF using the top left cell in your selection in the CF formula (i.e. if necessary change A1).
 
Upvote 0
Can't use array constants in refedits.
I missed that.
One would either have to define a Name
Name: listOfStrings RefersTo: ={"H","AH","PH"}

and the CF formula =ISNUMBER(MATCH(A1, listOfStrings, 0))

or put the list of highlighted strings in a range and refer to that.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

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