Conditional Formatting - Highlighting differing values

JTS25

New Member
Joined
Oct 10, 2019
Messages
26
Hi all,

If I have multiple columns that I'm identifing differences in, and what to highlight those differences. What conditional formatting formula could I use?

Example:

Columns A2 and B2 should be the same, but they are different values. I want to highlight both cells. This rule would be for columns A,B J,K Y,Z
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,645
1. Select columns A & B.
2. Home>Conditional Formatting>New Rule>Use a formula
3. Formula is: =$A1<>$B1
4. Choose format and click OK
Repeat for J,K and Y,Z.
 

JTS25

New Member
Joined
Oct 10, 2019
Messages
26
1. Select columns A & B.
2. Home>Conditional Formatting>New Rule>Use a formula
3. Formula is: =$A1<>$B1
4. Choose format and click OK
Repeat for J,K and Y,Z.
Thanks JoeMo!

If I'm going to use the same color to highlight all unique values, and there are around 1,000 rows per column. Could I write a single formula to capture everything? Or do I need to create a separate rule for each?
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,645
Thanks JoeMo!

If I'm going to use the same color to highlight all unique values, and there are around 1,000 rows per column. Could I write a single formula to capture everything? Or do I need to create a separate rule for each?
You are welcome - thanks for the reply.

The formula must be specific to the pair of columns so I think you need a separate rule for each pair of columns.
 

JTS25

New Member
Joined
Oct 10, 2019
Messages
26
1. Select columns A & B.
2. Home>Conditional Formatting>New Rule>Use a formula
3. Formula is: =$A1<>$B1
4. Choose format and click OK
Repeat for J,K and Y,Z.
Joe,
When entering this conditional format =$A1<>$B1 --> Format (Yellow)-->OK, both of the columns where highlighted but they are the same value. Any ideas on what went wrong?

Values could currency, numbers, words
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,645
Joe,
When entering this conditional format =$A1<>$B1 --> Format (Yellow)-->OK, both of the columns where highlighted but they are the same value. Any ideas on what went wrong?

Values could currency, numbers, words
If those values are floating point numbers, they could differ even though they look alike because your formatting truncates their visual appearance. Excel takes floating point numbers out to a precision of fifteen digits so 1.0000000000001 and 1.0000000000000 are different even though formatted to say 5 decimal places (1.00000) they appear to be identical.

In the case of text, be sure there are no extrat spaces in one cell entry when compared to the other. A simple test is to use: =LEN($A1)=LEN($B1) which should return TRUE if they are the same. Alternatively, =EXACT($A1,$B1) can be used to test.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,148
Office Version
365
Platform
Windows
If those values are floating point numbers, they could differ even though they look alike because your formatting truncates their visual appearance. Excel takes floating point numbers out to a precision of fifteen digits so 1.0000000000001 and 1.0000000000000 are different even though formatted to say 5 decimal places (1.00000) they appear to be identical.
That situation can be rectified by using the ROUND formula on each value, i.e.
Code:
=ROUND($A1,2)<>ROUND($B1,2)
 

JTS25

New Member
Joined
Oct 10, 2019
Messages
26
If those values are floating point numbers, they could differ even though they look alike because your formatting truncates their visual appearance. Excel takes floating point numbers out to a precision of fifteen digits so 1.0000000000001 and 1.0000000000000 are different even though formatted to say 5 decimal places (1.00000) they appear to be identical.

In the case of text, be sure there are no extrat spaces in one cell entry when compared to the other. A simple test is to use: =LEN($A1)=LEN($B1) which should return TRUE if they are the same. Alternatively, =EXACT($A1,$B1) can be used to test.
Thank you!
 

Forum statistics

Threads
1,078,273
Messages
5,339,190
Members
399,288
Latest member
ossa

Some videos you may like

This Week's Hot Topics

Top