Excel – Case-sensitive highlighting of duplicate cells in Excel

conditional formattingmicrosoft excel

I have a column of 1-2 letter IDs in excel. It's fine if the capitalization is different (i.e., "AB" and "Ab"), but it's an issue if any two are exactly the same (i.e., "AB" and "AB"), so I want to use conditional formatting to highlight those. It seems to me that Excel's built-in duplicate highlighting ignores case, and so does everything else I've tried that worked at all.

Some of the things I've tried as conditional formatting formulas (yes, I changed the ranges for my data):

From

https://www.excelbanter.com/new-users-excel/224771-condition-formats-duplicates-additional-criteria.html

=SUMPRODUCT(--EXACT(C$1:C$9,C1))1

was suggested. The "1" at the end seems to be an error, so I tried

=SUMPRODUCT(--EXACT(C$1:C$9,C1))

which highlighted everything, and:

=SUMPRODUCT(--EXACT(C$1:C$9,C1), 1)

which highlighted nothing.

From Match formula Excel case sensitive, I tried

=IF(ISERROR(MATCH(TRUE, EXACT(A2,$A$1:$A$2800),0)), 0, 1)

It highlights everything, which I assume is because the cell is in the range being searched?

Just testing the column for duplicates might be an acceptable compromise, so from http://cpearson.com/excel/Duplicates.aspx, I tried putting:

=IF(MAX(COUNTIF(A2:A11,A2:A11))>1,"Duplicates","No Duplicates")

in a different cell. It always showed "No Duplicates", even when I created new extra duplicates on purpose.

I've searched so hard for an answer without finding any that I'm worried it's either something really obvious, or basically impossible. Coming from programming languages where capitalization usually counts for string comparisons, it seems like something people would regularly want to do.

Best Answer

The first conditional formatting formula which you tried is probably supposed to be: =SUMPRODUCT(--EXACT(C$1:C$9,C1))>1

(That is it was missing the ">" symbol before the 1)

The formula calculates the number of cells in the column that are identical matches, and highlights if it is greater than 1.

This formula works for me with data similar to what you described in range C1:C9.

Related Question