Excel 2010 conditional formatting: selectively highlighting duplicates

Set up a conditional formatting rule for the entire table with the following formula:

=AND(COUNTIF($A$1:$A$6,A1)>0,COUNTIF($B$1:$B$6,A1)>0,COUNTIF($C$1:$C$6,A1)>0,COUNTIF($D$1:$D$6,A1)>0,COUNTIF($E$1:$E$6,A1)>0,COUNTIF($F$1:$F$6,A1)>0)

This checks that the value of the cell is in each column.

Example: enter image description here

To highlight values that are duplicated in 5 columns, you can use the following rule:

=SUM(COUNTIF($A$1:$A$6,A1)>0,COUNTIF($B$1:$B$6,A1)>0,COUNTIF($C$1:$C$6,A1)>0,COUNTIF($D$1:$D$6,A1)>0,COUNTIF($E$1:$E$6,A1)>0,COUNTIF($F$1:$F$6,A1)>0)=5

This can be customized to other numbers of duplicates by changing the last number of the formula.

Example: enter image description here