SubsetCount[list,sub]
gives a count of the number of times sub appears in any order as a sublist of list.
SubsetCount[list,patt]
gives the number of sublists in list that match the general pattern patt in any order.


SubsetCount
SubsetCount[list,sub]
gives a count of the number of times sub appears in any order as a sublist of list.
SubsetCount[list,patt]
gives the number of sublists in list that match the general pattern patt in any order.
Details and Options

- In SubsetCount[list,patt], patt can be an expression with head List that includes pattern constructs such as PatternSequence, Repeated (..), Blank (_) and BlankSequence (__).
- The pattern patt can also be a pattern that matches a list but does not itself have head List.
- With the default option setting OverlapsFalse, SubsetCount includes only sublists that do not overlap. With the setting OverlapsTrue, it includes sublists that overlap.
Examples
open all close allBasic Examples (2)
Properties & Relations (1)
The rules for counting are defined by the length of the result of SubsetCases:
Related Guides
History
Text
Wolfram Research (2020), SubsetCount, Wolfram Language function, https://reference.wolfram.com/language/ref/SubsetCount.html.
CMS
Wolfram Language. 2020. "SubsetCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SubsetCount.html.
APA
Wolfram Language. (2020). SubsetCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubsetCount.html
BibTeX
@misc{reference.wolfram_2025_subsetcount, author="Wolfram Research", title="{SubsetCount}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SubsetCount.html}", note=[Accessed: 16-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_subsetcount, organization={Wolfram Research}, title={SubsetCount}, year={2020}, url={https://reference.wolfram.com/language/ref/SubsetCount.html}, note=[Accessed: 16-August-2025]}