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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

gsistek

Well-known Member
Joined
Apr 4, 2011
Messages
660
Try:
=AND(ISNUMBER(MATCH(TRIM($F4),{"a","b","c"},0)),ISNUMBER(MATCH(TRIM($H4),{"a","b","c"},0)))
 
Upvote 0

coltheplumb

Well-known Member
Joined
Nov 27, 2010
Messages
731
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

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,100
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
An alternative formula

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

M.
 
Upvote 0

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,100
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
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,191,579
Messages
5,987,426
Members
440,096
Latest member
yanaungmyint

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
Top