conditional formatting

coltheplumb

Well-known Member
Joined
Nov 27, 2010
Messages
731
Hi All ok i have this in C/F in cell K4 =trim($f4)=”a” which turns cell K4 yellow when “a” is in f4 which works fine, how could i alter this so that it coves a bigger range, something like
=trim($f4, $H4)=”a,b,c” so will turn Cell K4 yellow only if an a,b or c appears in both cells F4 and H4. Or is this not possible.
All help appreciated
Colin X

 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try:
=AND(ISNUMBER(MATCH(TRIM($F4),{"a","b","c"},0)),ISNUMBER(MATCH(TRIM($H4),{"a","b","c"},0)))
 
Upvote 0
It looked wonderful but when i put it in I got this you may not use, intersections, or array constants for C/F criteria
 
Upvote 0
An alternative formula

=AND($F4<>"",ISNUMBER(SEARCH(TRIM($F4),"abc")),$H4<>"",ISNUMBER(SEARCH(TRIM($H4),"abc")))

M.
 
Upvote 0
No it doesn't like that either ;-(

Well it worked for me...

But, re-thinking, i realized that the formula has some flaws.

The best you can do is:
1. Create a range with 3 cells containing
a
b
c

2. Name it, say, MyRange

3. Use the formula suggested above by gsistek replacing the array {"a";"b";"c"} by MyRange, i.e.,

=AND(ISNUMBER(MATCH(TRIM($F4),MyRange,0)),ISNUMBER(MATCH(TRIM($H4),MyRange,0)))

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,214,396
Messages
6,119,268
Members
448,881
Latest member
Faxgirl

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