Compare two ranges, highlight cell with text in one range missing from other

dkjonesau

New Member
Joined
May 9, 2014
Messages
47
Hi all,

I've been trying to find a formula that I can use in a conditional format to solve this problem. I've searched quite a bit and still haven't found a solution.

In the table below Test 5 appears in the larger range B1:K3 but in the smaller range in column A (A4:A8) it's missing.


ABCDEFGHI JK
1Test 1Test 1Test 2Test 2Test 3Test 3Test 4Test 4Test 5Test 5
2Test 1Test 1Test 3Test 1Test 3Test 3Test 4Test 4Test 5Test 5
3Test 1Test 1Test 3Test 5Test 3Test 3Test 6Test 4Test 5Test 5
4Test 1
5Test 2
6Test 3
7Test 4
8Test 6

Is there a formula I can use to apply conditional formatting to range B1:K3 to highlight the cell containing Test 5?

In the real example the cells all contain text strings, not numbers.

Alternatively, is there a way to create the list in the smaller range using something like UNIQUE from the larger range? UNIQUE only appears to work on columns, not ranges across several columns.

Thanks,

Dave
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about
Excel Formula:
=COUNTIF($A$4:$A$8,B1)<1
 
Upvote 0
How about
Excel Formula:
=COUNTIF($A$4:$A$8,B1)<1

Hi Cubist

I wanted to compare the entire range to the entire range if possible. Not have to setup 32 individual conditional format conditions and have to add more each time the bottom list grows.

Wouldn’t your example only compare B1 to the list? Other than the example here my real table is 70 columns wide, 26 high and the comparator list has 32 entries.

DJ
 
Upvote 0
Hi Cubist

I wanted to compare the entire range to the entire range if possible. Not have to setup 32 individual conditional format conditions and have to add more each time the bottom list grows.

Wouldn’t your example only compare B1 to the list? Other than the example here my real table is 70 columns wide, 26 high and the comparator list has 32 entries.

DJ
You would enter that formula in the conditional formatting for cell B1, then Ctrl + C to copy, and then highlight the rest of the cells. Ctrl + Alt + V - > All merging conditional formats.
 
Upvote 0
Solution
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Below is @Cubist's suggestion showing that you only need 1 rule. I have modified slightly as checking that the count is <1 seems a bit funny to me since the only count possible <1 is zero.
(I have altered the sample data slightly to show that still only 1 rule is required to highlight any value not appearing in the smaller list)

You would enter that formula in the conditional formatting for cell B1, then Ctrl + C to copy, and then highlight the rest of the cells. Ctrl + Alt + V - > All merging conditional formats.
I would normally do the implementation differently. I would select B1:K3 first and then apply the CF rule with Excel automatically adjusting the formula for the other selected cells.

24 03 29.xlsm
ABCDEFGHIJK
1Test 1Test 1Test 2Test 2Test 3Test 3Test 4Test 4Test 5Test 5
2Test 1Test 1Test 3Test 1Test 3abcdTest 4Test 4Test 5Test 5
3Test 1Test 1Test 3Test 5Test 3Test 3Test 6Test 4Test 5Test 5
4Test 1
5Test 2
6Test 3
7Test 4
8Test 6
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1:K3Expression=COUNTIF($A$4:$A$8,B1)=0textNO
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
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