Weird. Duplicated values highlighted in Excel, but they are clearly not duplicates!

Occasional Contributor

In excel, I am getting warning of duplicated values from this list. This prevents me from creating a data model relationship one to many. However, the values are not duplicated at all:











Isn’t it weird? Have you experienced something like this previously, and if so, is there a known solution for it?


18 Replies

@Elipum Clearly, the texts you included in your question contain no duplicates. So, there must be something else triggering the warning. And I suspect that you are trying to set relationships between two tables. 

If you copy those values in a blank excel, and set the conditional formating of: Highlight duplicate values, does this error also happen to you?

@Elipum No. None are highlighted. But that may be because I'm copying some texts from this web site. Why don't you upload a file that demonstrates the problem?

Of course. Just loaded the file to the main post now.

@Elipum ???? There are no duplicates in this file. 

@Riny_van_Eekelen really? See screenshot. They do show as duplicates on my file (all red).

If you delete any of the cell values, one of the other cells becomes white, meaning, its duplicate has been deleted. But obviously they were not duplicates at all!

May this be an Excel bug then? it has no sense...


Could you share the file with conditional formatting rule applied?

@Sergei Baklan , the file I uploaded already has the conditional formatting applied.





Thank you, but my Excel shows no duplicates in your file


I don't know what's the reason, sorry. By the way, some cells in above range have General format, some hh:mm. Is that intentionally?

Thanks for the time Sergei. The format I gave them was Text for all. I don't know why it is changing when opening in your side. Maybe that is part of the use. Some cache or big on my side..?
They are meant to be formated as text all. Weird

I'm sure there is a simple explanation for everything.  You just have to abandon your "weird" thoughts, and look for the obvious.  For example....



@Elipum  wrote: ``The format I gave them was Text for all. I don't know why it is changing when opening in your side.``


The __type__ of the data is text.  That is, ISTEXT returns TRUE for all of A1:A8.  But that is because the data is prefixed with an apostrophe (single-quote).  You would not have had to do that if the cell formats were Text.


In contrast, the __format__ of the cells is a mix of General (A1:A3, A6) and Custom "h:mm" (A4:A5, A7:A8).  Look for yourself to confirm.  But the cell format does not matter.  We can have text __values__ in cells with numeric formats, and numeric __values__ in cells that are formatted as Text.



@Elipum  wrote: ``Duplicated values highlighted in Excel, but they are clearly not duplicates!``


Just because they have the same appearance as the Condition Formatting, that does not mean that CF caused the appearance.


To confirm, temporarily change the CF font and fill colors.  I suspect that you will not see any changes in A1:A8.


OTOH, I note that the __style__ of A1:A8 is a __custom__ style called Normal 2.  In contrast, by the default, the cell style is Normal.  (Errata.... The style for A1 is Percent!  But I suspect the following applies to it as well!)


On my system, the characteristics of Normal 2 is the same as Normal.  That is why __we__ do not see any difference in font and fill color.


But I suspect __your__ Normal 2 style specifies the same font and fill color as your CF.  That is why it __appears__ as if the CF applied.  (It did not.)


Right-click Normal 2, and click Modify.  This is what I see.




But I suspect you see the following, which is the Bad style for me:


bad p1.jpg


Drill down on Format > Font and Format > Fill to see the details.


I can only guess why __we__ do not see the same characteristics for the Normal 2 style.  Perhaps those details are in the local computer's Registry, not in the Excel file.  (Surprise!)


And then there is the anomaly of style Percent in A1 to explain.  "The exercise is left for the student".  (wink)  My wild guess:  A1 is also the Normal 2 style for you.



yes I have please show us the tables you are trying to set relationships, as well as your dim table values.



there's your duplicate values:



If they're phase numbers to a project you should format them as text or use a hyphen to make sure excel will automatically format them as text

I also noticed that you did put an " ' " and I also formatted the cells as text and yet the INT() function was still able to convert them as integers, now if the excel engine does that then they will always be duplicate values so then  I added .00 after the first decimal point:


and it produced an error. #value as it does when I added a hyphen:


so its probably safer to either add a hyphen or add a decimal with trailing zeroes in order to be consistent


It looks like rule highlights unique values even if you set it for duplicates. If on your machine you you have two same values in the list will they be highlighted?

@Elipum I'm struggling with a similar issue with non-duplicate cells being conditional-formatted as duplicate.


In my case (by complete chance) I may have stumbled on the error.

I have found two cells with "12-14" and "14-12" which throw up a duplicate.

Both cells are formatted as "Text".

I suspect the non-numerical entry (for me the minus sign) may be the problem.


Not very helpful though ... as I don't have a solution!