Compare two columns and highlight differences
This article demonstrates a conditional formatting formula that will highlight the differences between two columns. The image above shows two cell ranges containing values, the first one is in column B and the second one is in column D.
Values "BB", "GG", and "GG" are highlighted, they only exist in column B. Values "DD" and "FF" are highlighted, they only exist in column D.
Table of Contents
Conditional formatting is a built-in feature that allows you to format specific cells based on a condition or criteria.
The conditional formatting formula presented in this article highlights values that only exist in one column, in other words, they differ from the values in the other column. You can pick any format or fill color and the formula lets you build advanced criteria that must be met.
1. How to highlight values
- Select cell range B3:B7.
- Go to tab "Home" on the ribbon if you are not there already.
- Press with mouse on the Conditional Formatting button.
- Press with mouse on "New Rule...".
- Press with mouse on "Use a formula to determine which cells to format".
- Type: =AND($D$3:$D$7<>B3)
- Press with mouse on "Format..." button.
- Press with mouse on "Fill" tab.
- Pick a color.
- Press with left mouse button on OK.
- Press with left mouse button on OK.
Repeat above steps with column D, the formula is =AND($B$3:$B$7<>D3)
2. Explaining conditional formatting formula
Step 1 - Check if cell range D3:D7 is not equal to cell B3
Reference $D$3:$D$7 is an absolute cell reference meaning it is locked, it won't change when the CF moves to the next cell.
The less than and larger than sign combined means not equal to.
$D$3:$D$7<>B3
becomes
$D$3:$D$7<>B3
and returns {TRUE; TRUE; TRUE; TRUE; TRUE}.
Step 2 - Check if all boolean values are TRUE
AND($D$3:$D$7<>B3)
AND($D$3:$D$7<>B3)
becomes
AND({TRUE; TRUE; TRUE; TRUE; TRUE})
and returns TRUE. Cell B3 is highlighted.
3. Get Excel *.xlsx
Cf compare category
Today I am going to show you how to quickly compare two tables using Conditional Formatting (CF). I am going […]
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 […]
In this blog post I will demonstrate a conditional formatting formula that will highlight common records in two lists. The […]
The image above demonstrates a conditional formatting formula that highlights records that only exist in one table. There are two […]
The picture above shows two lists. How do I highlight values in List 1 that are not in List 2? […]
Conditional formatting category
The image above demonstrates a conditional formatting formula that colors a record if there is at least one record that […]
This article explains how to count cells highlighted with Conditional Formatting (CF). The image above shows data in cell range […]
adam asks: Hi, I have a situation where I want to count if this value is duplicate and if it […]
Question: How do I highlight dates that meet criteria using conditional formatting? Table of contents Highlight values in a column […]
This post demonstrates how to highlight records with the closest value to a criterion, you can also choose to highlight […]
The image above shows rows highlighted based on value in column C being the largest or smallest in that particular […]
This article shows you how to easily identify duplicate rows or records in a list. What's on this webpage Conditional […]
The image above demonstrates a conditional formatting formula applied to an Excel Table containing random data. The Excel Table has […]
Here is how to highlight every other row using conditional formatting. Conditional formatting formula: =ISEVEN(ROW())*OR($B3:$D3<>"") Alternative CF formula: =EVEN(ROW())=ROW() This […]
Question: I have a list that I keep adding rows to. How do i create a border that expands as […]
The image above shows you how to highlight rows with multiple criteria using OR logic. The criteria are found in […]
In this article, I will demonstrate how to search a table using conditional formatting. The criteria highlight matching column and […]
Today I am going to show you how to quickly compare two tables using Conditional Formatting (CF). I am going […]
The image above demonstrates a conditional formatting formula that highlights duplicate items based on date. The first instance is not highlighted, […]
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 […]
In this post I am going to try to explain formula basics in conditional formatting. It is really good if […]
The image above shows conditional formatting highlighting unique distinct values, duplicates are not highlighted. Conditional Formatting Formula: =COUNTIF($B$3:B3, B3)=1 The […]
This article demonstrates how to apply different cell formatting to a cell range based on a Drop Down list, column […]
In this blog post I will demonstrate a conditional formatting formula that will highlight common records in two lists. The […]
The image above demonstrates a conditional formatting formula that highlights records that only exist in one table. There are two […]
Conditional Formatting categories
Excel categories
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.