Hi,
the formula works opposite way, it highlights unique values (duplicates stay untouched). To highlight duplicates it should be negated.
As you noted first vlookup just checks if a word is anywhere on a list (could use here MATCH as well, but the same formula is used also in second part). So it it is listed - returns a synonyms group number if not returns error resulting in no CF appled in that cell
As for:
the innermost part is:
as we copy it down it becomes
and so on.
so the output is a table 8 rows (1:8) by n columns
we do transpose to change A1:An rows into columns
the table contains comparisons of A1...An values with allowed item names.
Then we have IF ariound it:
is comparison is true the position in table is substituted with "number of synonyms group" else it is substituted with empty string
then we compare number of group for text entered (A2) with every item in a table
and result is table of boolean values true/false
so we convert these values to numbers using just
and sum all these numbers with simple
If there was any item from the same synonyms group in cells above, the sum will be non-zero, wile if it is first occurence of given group the sum is 0.
Now we do negation (so the number is now treatred as boolean value - if 0 then treated as false , any other number treated as true) and negated true is false (of course negated false is true)
We multiply this (so again true becomes 1 and false 0) by te Vlookup from the front and here we are
... writing this (still probably not very descriptive text) took me (i think) some 20 times longer than writing the formula :-D
Note that in transpose(A$1:An) we start from the cell not containing any word expected. we could start from A2 but then we shall have separate conditional formatting for cell A2 and other for all next cells, so I did it that way to have just one universal formula.
Hope it clears view a bit
Bookmarks