Lookup - if not found, change color

kenetyw

New Member
Joined
Mar 26, 2009
Messages
2
I am trying to figure out how to write a formula that will take every value from one sheet and compare them to another. I want any values that aren't found on the second sheet to change background color so I know that the other sheet doesn't have them.

Anyone have any ideas? I'm sure this is super simple if you know how to do it.

Thanks in advance!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
hi and welcome to the board!!
Say your Sheet1 values are in column "A". Select column "A" and assign it a Name. Insert>Name>Define(say myRange). Now on Sheet2, select the column with numbers and Choose Format>Conditional Formatting. Use Formula IS option
Code:
=ISERROR(MATCH(A1,myRange,0))*(A1<>"")
Select a background color.
lenze
 
Upvote 0
Thank you for your quick response.

I'm using the new Office so things were a little different, but I got the formula in just fine.

However, all it does is highlight every item entry on sheet2. This could be because in sheet1 the items are just a list: 60001-DG, 6001-00,1189-00, etc. but on the second sheet the item numbers were divided, with the part before the hyphen in one column and the part after in another. I got around this by making a column that displayed the two together (=B255&"="&c255). Does the match formula compare the output of the cells or their actual contents?
 
Upvote 0
MATCH compares the value of one cell to the values in a list or array and returns the position as a number of that item in the list. If a match is found, a number is returned. If no match, you get an error. That error is what the CF formula tests for.
lenze
 
Upvote 0

Forum statistics

Threads
1,202,964
Messages
6,052,829
Members
444,602
Latest member
Cookaa

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