Highlight Unique Row - Based on First Three Columns Only

elfmajesty

New Member
Joined
Sep 28, 2004
Messages
39
Good afternoon, all. I have what I thought would be an easy thing to do, but I am having some troubles. I've researched and read many threads here to see if I could find it before posting here, but I've not had any luck. I'm on Excel 2010, too.

In my spreadsheet all records are unique rows due to Column E. However, I need to simply highlight any rows that are unique based on only the first three columns of the sheet.
I don't want anything removed or sorted, or changed in any way just highlighted. It will be a bit difficult to explain without being able to post a picture, but I'll do my best. I have this:

Number Yes/No Code Location CityCode
1 12 Yes NR LocationA 5896
2 12 Yes NR LocationC 2245
3 15 Yes NR LocationA 6879
4 15 Yes NR LocationC 1143
5 28 No NR LocationA 3456
6 28 Yes NR LocationC 7567
7 67 Yes NR LocationA 1245
8 67 Yes NR LocationC 9876
9 13 Yes PZ LocationA 8907
10 13 Yes NR LocationC 5576
11 95 Yes NR LocationA 3786
12 95 No NR LocationC 4679
13 68 Yes NR LocationA 1009
14 68 Yes NR LocationC 1675



I need to highlight the "unique" rows only looking at columns A, B and C. Thus, rows 5 and 6 would be "unique", rows 9 and 10 would be "unique" and rows 11 and 12 would be "unique".

It's a different situation than just simply using the conditional formatting to highlight unique values.

Any advice would be appreciated!

Thanks very much in advance,
LBurr
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Okay - just found the download for the HTML code to post actual example - saw everyone else doing it! : ) (Very nice, by the way.) Here is a look of my example better:

Excel Workbook
ABCDE
1NumberYes/NoCodeLocationCityCode
212YesNRLocationA5896
312YesNRLocationC2245
415YesNRLocationA6879
515YesNRLocationC1143
628NoNRLocationA3456
728YesNRLocationC7567
867YesNRLocationA1245
967YesNRLocationC9876
1013YesPZLocationA8907
1113YesNRLocationC5576
1295YesNRLocationA3786
1395NoNRLocationC4679
1468YesNRLocationA1009
1568YesNRLocationC1675
Sheet4
 
Upvote 0
Here's an idea that uses one extra column (anywhere you like), and conditional formatting. In this example I used column Z.
With row 1 being your first row of data, in Z1 enter the formula:
Code:
=A1&B1&C1
and copy down as far as your data goes. (I assumed row to 1000.)

Then, in cell A1, use conditional formatting with the formula:
Code:
=COUNTIF($Z$1:$Z$1000,$Z1)=1
(changing the 1000 to your real last row with data) and use Format painter to copy the (conditional) format of A1 and 'paste' it to all rows of data in column A - or columns A, B & C if you like.

Hope it helps.
 
Upvote 0
Select A2:F? till the end of the data (A2:F15 in your data sample) and

Conditional Formatting > New Rule > Use a formula to determine which cells to format

enter this Formula (Excel 2007 or higher)
=COUNTIFS($A:$A,$A2,$B:$B,$B2,$C:$C,$C2)=1

pick the format you want

M.
 
Upvote 0
Marcelo and HalfAce - both of these worked perfectly! Exactly what I needed. Thank you both very much for helping me think outside the box today.

Cheers to you,
elf
 
Upvote 0
Well, unfortunately, I think I've spoken too soon on this. I might need something different. It appears the formula will only work if there is only exactly TWO records to check againt each other, no more and no less. Marcello, I used yours for Conditional Formatting to make them BOLD/RED font. I also have put it in a forumla in another column as this:
=IF(COUNTIFS($A:$A,$A2,$B:$B,$B2,$C:$C,$C2)=1,"Conflict","OK")
to show it a bit better.

For multiples, I need to show the whole grouping as highlighted somehow. If you look at rows 12, 13 and 14 - I need them all to highlight to show that in the 95 group, the data is not all the same in columns A, B and C (even though 13 and 14 are).

For completely unique entries (with no grouping from column A), I do not want those to highlight.

I'm still playing around with some things, but thought I'd throw this back out there.

Thanks in advance,
elf




Excel Workbook
ABCDEFG
1NumberYes/NoCodeLocationCityCodeUSING FORMULA*
212YesNRLocationA5896OK*
312YesNRLocationC2245OK*
415YesNRLocationA6879OK*
515YesNRLocationC1143OK*
628NoNRLocationA3456Conflict*
728YesNRLocationC7567Conflict*
867YesNRLocationA1245OK*
967YesNRLocationC9876OK*
1013YesPZLocationA8907Conflict*
1113YesNRLocationC5576Conflict*
1295YesNRLocationA3786Conflict*
1395NoNRLocationC4679OKNEED THIS TO BE CONFLICT, TOO
1495NoNRLocationE6675OKNEED THIS TO BE CONFLICT, TOO
1568YesNRLocationA1009OK*
1668YesNRLocationC1675OK*
1778NoNRLocationA9967OK*
1878NoNRLocationC1453OK*
1976YesNRLocationA2756ConflictTHIS SHOULD NOT BE A CONFLICT
2028YesPZLocationA9789ConflictTHIS SHOULD NOT BE A CONFLICT
Sheet4


the
 
Upvote 0
Let's try this one instead, since I didn't realize that I had a grouping of "28" which made row 20 on the previous example a bit confusing.

Excel Workbook
ABCDEFG
1NumberYes/NoCodeLocationCityCodeUSING FORMULA*
212YesNRLocationA5896OK*
312YesNRLocationC2245OK*
415YesNRLocationA6879OK*
515YesNRLocationC1143OK*
628NoNRLocationA3456Conflict*
728YesNRLocationC7567Conflict*
867YesNRLocationA1245OK*
967YesNRLocationC9876OK*
1013YesPZLocationA8907Conflict*
1113YesNRLocationC5576Conflict*
1295YesNRLocationA3786Conflict*
1395NoNRLocationC4679OKNEED THIS TO BE CONFLICT, TOO
1495NoNRLocationE6675OKNEED THIS TO BE CONFLICT, TOO
1568YesNRLocationA1009Conflict*
1668*NRLocationC1675OK*
1778NoNRLocationA9967OK*
1878NoNRLocationC1453OK*
1976YesNRLocationA2756ConflictTHIS SHOULD NOT BE A CONFLICT
2045YesPZLocationA9789ConflictTHIS SHOULD NOT BE A CONFLICT
21*******
Sheet4
 
Upvote 0
Hmm...i'm not following you...

My formula does exactly what you asked in your first post.

In my spreadsheet all records are unique rows due to Column E.However, I need to simply highlight any rows that are uniquebased on only the first three columns of the sheet.

Why rows 19 and 20 should not be highlighted? They are unique considering columns A, B and C.

And why rows 13 and 14 should? They are not unique.

I'm lost...

M.
 
Last edited:
Upvote 0
One question: is the value in row 16 column B "*" correct? Or is it a typo? Shouldn't it be Yes or No?

M.
 
Upvote 0
Hi, Marcelo. 16 B was a typo, yes. Your formula is great and does work like it should. However, upon utilizing, we realized it wasn't quite what we needed once we had it implemented on a larger set of data.

I can see where your confusion is and that's why I'm thinking I might need something slightly different than simply highlighting unique rows. : )

Rows 12, 13 and 14 are the best example here. What we were trying to show is where there are records that are within the same Number group (i.e. 95) that are not EXACTLY the same across all of them in the "Yes/No" and the "Code" within the group. Thus BOTH rows 13 and row 14 conflict with row 12 and we'd like to highlight the entire group as having a conflict.

Also, because the formula is designed to highlight unique, any record that is the only one in a "Number group" (i.e. rows 19 and 20) does highlight the way it should. However, there is nothing to "conflict" with, so we do not really need to show those.

Simply put, we are looking to find inconistencies within records that have more than one in the Number group.

I'm still working on a few thoughts about it and think we may have a solution. However, any thoughts from you would be appreciated as well.

Thanks for taking the time.

Cheers,
elf
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,011
Members
449,204
Latest member
tungnmqn90

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