It seems that it's not possible to find contacts who are in group A, but not in group B. The only place where it's possible to exclude a group is Search Builder, but when I give two criteria (contact is in group A) and (contact is not n group B) CiviCRM ignores the second clause.

I tried to convert the second clause to use a Tag. So I've created a tag for group B, and searched for contacts in group A and contacts not in tag B.

The result is really puzzling, and it seems I am not following CiviCRM's logic:

CiviCRMS logic

(this is polish l10n, but "Etykieta" and "Kategorie" are both translations for "Tag") Could someone clarify, what is happening here?

2 Answers 2


You should use the custom search "Include / Exclude Search" that does exactly what you want

civicrm/contact/search/custom?csid=4&reset=1 on my install, likely the same custom search id on your install

  • This should be the accepted answer. Extremely useful, but kinda hidden, search function.
    – thoni56
    Commented Nov 23, 2015 at 9:48

The issue with the Search Builder is that it's not doing an exclude when you say NOT IN. Instead, it's selecting contacts who have any tag besides the one you listed.

This is because groups and tags are entities themselves, and contacts may be related to an unlimited number of them. Having a tag that is not X is a different thing than not having the tag X.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.