Conditional Format Duplicate Cell Values in Each Row in Google Sheets

3.5k views Asked by At

I can't quite figure this out:
I want to Conditional Format Duplicate Cell Values in Each Row in Google Sheets. Say you have this data set:

https://docs.google.com/a/nols.edu/spreadsheets/d/1iVNk07-HeqMN2wnLP5IyORov-j20-PAY3KHNF5D7xfI/edit?usp=sharing

I want a formula to highlight the cells containing duplicates in an individual row for all rows.

So in the first it should highlight the 1s in the 2nd and 3rd column. In the second row it should highlight the 2s in in the 2nd and 3rd column. In the third and fourth row, nothing should highlight. In the fifth row, the 6s in the 1st and 2nd column should highlight.

It should NOT highlight the 2 in the 3rd row, because that is the only 2 in that row.

Any help is appreciated!

2

There are 2 answers

0
pnuts On

Can't really tell without sight of you sheet but perhaps something like the following as a Custom formula is:

=countif($A1:$E1,A1)>1  

with formatting of your choice applied to Range: A:E.

0
Joe On

Try this...

=countifs(INDIRECT({"A1:E1"}),A1)>1

Change the "A1:E1" range to suit your needs.

The indirect() function allow the countifs() function to highlight both occurrences of a duplicate rather than just one.

Change the ">1" at the end to suit your needs... 1 matches duplicates greater than 1 occurrence, 2 matches if there is more than 2 duplicates etc

Sorry if its not quite right for you. I'm no expert at this, hope that it helps you.