Tally
tallies the elements in list, listing all distinct elements together with their multiplicities.
uses test to determine whether pairs of elements should be considered equivalent, and gives a list of the first representatives of each equivalence class, together with their multiplicities.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (3)Survey of the scope of standard use cases
Results are returned in order of first occurrence in the list:

https://wolfram.com/xid/0bimqcq4-dtg63s

Count the instances of randomly generated integers:

https://wolfram.com/xid/0bimqcq4-boob44

Elements of the list can be any expression:

https://wolfram.com/xid/0bimqcq4-eflpej

Applications (1)Sample problems that can be solved with this function
Properties & Relations (5)Properties of the function, and connections to other functions
Elements with highest frequencies are given by Commonest:

https://wolfram.com/xid/0bimqcq4-nqs6t


https://wolfram.com/xid/0bimqcq4-iv5hh7

A sorted Tally is equivalent to a list of counts for the Union:

https://wolfram.com/xid/0bimqcq4-gpz0if


https://wolfram.com/xid/0bimqcq4-jag94w

Tally is a discrete analog of BinCounts:

https://wolfram.com/xid/0bimqcq4-htjze5


https://wolfram.com/xid/0bimqcq4-okx53


https://wolfram.com/xid/0bimqcq4-he7bxm

Counts[list] returns an association in which values are the tallies of their keys:

https://wolfram.com/xid/0bimqcq4-xektry


https://wolfram.com/xid/0bimqcq4-63of9c

Use the second argument of Tally to construct its corresponding by-function:

https://wolfram.com/xid/0bimqcq4-qbleql
Count odd and even numbers in a list:

https://wolfram.com/xid/0bimqcq4-1zbjm8

Wolfram Research (2007), Tally, Wolfram Language function, https://reference.wolfram.com/language/ref/Tally.html.
Text
Wolfram Research (2007), Tally, Wolfram Language function, https://reference.wolfram.com/language/ref/Tally.html.
Wolfram Research (2007), Tally, Wolfram Language function, https://reference.wolfram.com/language/ref/Tally.html.
CMS
Wolfram Language. 2007. "Tally." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Tally.html.
Wolfram Language. 2007. "Tally." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Tally.html.
APA
Wolfram Language. (2007). Tally. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Tally.html
Wolfram Language. (2007). Tally. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Tally.html
BibTeX
@misc{reference.wolfram_2025_tally, author="Wolfram Research", title="{Tally}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Tally.html}", note=[Accessed: 06-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_tally, organization={Wolfram Research}, title={Tally}, year={2007}, url={https://reference.wolfram.com/language/ref/Tally.html}, note=[Accessed: 06-June-2025
]}