I have a list of fruit occurrences like this:
banana
banana
apple
orange
apple
And I want LibreOffice to give me a number of occurrences per fruit, for instance:
banana | 2
apple | 2
orange | 1
How can I do this?
I guess that a pivot table would to require a column full of "1", and it is a pain to create this column.
Best Answer
There are (at least) two solutions:
1. Pivot table
The following pivot table layout...
will give you the following output:
2. COUNTIF and distinct values
Another approach involves the
COUNTIF
function. You can create the "result table" in two simple steps:Create a list of distinct values (fruit names) using a standard filter:
Apply the countif function to all of the resulting distinct values like this:
=COUNTIF($A$2:$A$6;A9)