I am not clear as to how you set up the count.
If you are doing it in SQL you can change your query to include a 'Having' statement which kind of acts like a 'Where' statement for Group By.
You could create a formula or series of formula that checks the count by using an IF statement
If 'distinct count' > = 2 then .....
If the SQL query is something that will work for your needs it is in my humble opinion the better solution.
Hope this is of some help.
Regards,
John W.