I am aware we have the function Duplicates() at our disposal. Nevertheless, this template makes use of what I call a Group Index.
The logic can be applied in various ways. For demonstration purposes I assumed it was easy to only set the buttons active that are on a row with a duplicate.
A duplicate is a row that is counted more than once, thus contains a number higher than 1 (2 → n)