Counting distinct values
AFAIK there's still no built-in formula to count distinct values in a range. But there are different formulas around that do the same. I've tested two formulas working fine with your example data in LibreOffice 3.5:
The first is (courtesy Bigyan Bhar):
The second, more complex one, is an array formula, so you need to hit CTRL+SHIFT+ENTER after you entered it (courtesy David Chapman):
each with "Data" replaced by the range to evaluate.
Listing distinct values
To list distinct values, just define a filter on the input range, excluding duplicates:
(There's currently a bug in libreoffice preventing the user from disabling the "
Range contains column labels" checkbox, but it will be fixed in 3.5.2.)