COUNTIF treats “abc123” and “ABC123” as the same value, so it reports no duplicates in a list where two codes differ only by case. If your codes are case-sensitive, that blind spot lets a duplicate slip through and a lookup return the wrong row. Use EXACT, which compares case, to find the pairs COUNTIF misses.
What you need
- Excel with the code column to check
- An empty helper column beside the codes
- A note of whether the codes are meant to be case-sensitive
Step 1: Add an EXACT check against the first occurrence
In the helper column, enter a formula that compares each code with the codes above it using EXACT, for example =SUMPRODUCT(–EXACT($A$2:$A2,A2))>1, and fill it down. A TRUE result marks a code that already appeared with the same case.
Step 2: Compare the EXACT count with the COUNTIF count
Count the duplicates with COUNTIF as well and compare the two counts. If COUNTIF finds more duplicates than EXACT, the extra pairs differ only by case and are not true duplicates.
Step 3: Decide for each case-only pair whether it is a duplicate
Read each pair that differs only by case and decide from the source whether the two codes are the same item typed differently or two different items. Fix the case or keep both, and record the decision.
Worked example: synthetic eight-code list
The table below is a synthetic example. It shows the expected result of a case-sensitive duplicate check; no formula was run.
| Check | Count | Result |
|---|---|---|
| Codes in the list | 8 | Source |
| Duplicates found by COUNTIF | 2 | Includes case-only pairs |
| Duplicates found by EXACT | 1 | True duplicate only |
| Case-only pairs | 1 | abc123 vs ABC123 |
| True duplicates to remove | 1 | Same code, same case |
Expected result (UNTESTED). COUNTIF finds 2 duplicates but EXACT finds only 1, because abc123 and ABC123 differ by case and are different codes. Only the 1 true duplicate is removed. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- EXACT compares text exactly, so a trailing space still makes two codes different; trim first.
- A helper formula that compares each row with all rows above it slows down on very long lists.
- Sorting is not case-sensitive in Excel either, so case-only pairs sit next to each other and look like one value.
- If the codes are not meant to be case-sensitive, standardise the case instead of using EXACT.
