I'm trying to write a formula that will count the number of instances where there is duplicate data in a cell.
At the moment I'm using:
=SUM(--(COUNTIF(B4:B10000,UNIQUE(B4:B10000))>1)/2)
(I divide the result by 2 as I'm not interested in the total number of duplicate values, I just want to know the number of instances.)
This works fine when the data is identical like:
00309
00309
(Expected result here would be 1)
And it also works when the data is (which is what I want it to do)
00309
000309
(Expected result here would be 1)
However, there are times when the data is something like:
00309
00309DoNotUse
000309 On Hold
(Ideally I'd also like the result here to be 1)
The formula misses these.
It is only the number that I'm interested in finding if it's been duplicated. For example:
00309
000309 On Hold
00310 On Hold
000311 On Hold
Should still produce a result of 1
Is there a way to count the number of duplicates in this way? I would like not only to have a cell that displays the number of duplicates but also to be able to apply conditional formatting using the same parameters.
Bookmarks