A good source of hints and tips for OOo Calc can be the numerous Excel blogs. One of the best is from Dick Kusleika.
This formula for counting the number of unique items in a range of cells was one of three suggested by Dick – but the only one that ported successfully to OOo Calc.
It is an array formula. Use Ctrl-Shift-Enter when entering it.
where A1:A10 is the range being analyzed..