Compare tables: Highlight records not in both tables
The image above demonstrates a conditional formatting formula that highlights records that only exist in one table. There are two tables in this example: List 1 and List 2.
If you are looking for a conditional formatting formula that highlights records shared by both tables: Compare tables: Highlight common records. There is also an article that demonstrates how to filter records not in both tables.
The conditional formatting formula does not work with cell references outside the current sheet so we need to rely on named ranges for this to work.
Create named ranges
- Select A2:A13 on sheet "List 2"
- Type Year in Name Box
- Press Enter
Repeat with remaining ranges:
Sheet: List 2 , Range:B2:B13, Name: Asset
Sheet: List 2 , Range:C2:C13, Name: Cost
Sheet: List 1 , Range:A2:A11, Name: Year1
Sheet: List 1 , Range:B2:B11, Name: Asset1
Sheet: List 1 , Range:C2:C11, Name: Cost1
Highlight records existing in only one list
How to apply conditional formatting formula:
Sheet: List 1
- Select cells A2:C11 (Sheet: List 1)
- Click "Home" tab
- Click "Conditional Formatting" button
- Click "New Rule.."
- Click "Use a formula to determine which cells to format"
- Type =COUNTIFS(Year, $A2, Asset, $B2, Cost, $C2)=0 in "Format values where this formula is TRUE" window.
(The formula displayed in the image above is not used in this article) - Click "Format.." button
- Click "Fill" tab
- Select a color for highlighting cells.
- Click "Ok"
- Click "Ok"
- Click "Ok"
Sheet: List 2
- Select cells A2:C13 (Sheet: List 2)
- Click "Home" tab
- Click "Conditional Formatting" button
- Click "New Rule.."
- Click "Use a formula to determine which cells to format"
- Type =COUNTIFS(Year1, $A2, Asset1, $B2, Cost1, $C2)=0 in "Format values where this formula is TRUE" window.
(The formula displayed in the image above is not used in this article) - Click "Format.." button
- Click "Fill" tab
- Select a color for highlighting cells.
- Click "Ok"
- Click "Ok"
- Click "Ok"
Highlight records existing in only one list, excel 2003
The COUNTIFS function was introduced in Excel 2007 and if you have an earlier version you need another formula shown below. The COUNTIF functions returns arrays that are multiplied, the SUMPRODUCT function then adds the numbers and returns a total.
Sheet: List 1
Conditional formatting formula:
Sheet: List 2
Conditional formatting formula:
Sheet: List 1
Sheet: List 2
How to highlight differences in price lists
Today I am going to show you how to quickly compare two tables using Conditional Formatting (CF). I am going […]
Compare two columns and highlight values in common
A conditional formatting formula highlights values in column B that also exist in column D. =COUNTIF($D$3:$D$7,B3) The same thing happens […]
Compare two columns and highlight differences
A conditional formatting formula highlights values that only exist in one column. Example, BB and GG exist only in column […]
Remove common records between two data sets
This article demonstrates how to filter records occurring in only one out of two Excel defined tables. It also shows […]
Filter shared records from two tables
I will in this blog post demonstrate a formula that extracts common records (shared records) from two data sets in […]
Unique distinct records sorted based on count or frequency
Sara asks: How can you use large with multiple criteria?? Example looking for top 5 of a list based on […]
Compare two lists of data: Highlight common records
In this blog post I will demonstrate a conditional formatting formula that will highlight common records in two lists. The […]
2 Responses to “Compare tables: Highlight records not in both tables”
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
[…] Compare two lists of data: Highlight records existing in only one list in excel […]
[…] Compare two lists of data: Highlight records existing in only one list […]