COUNTIF doesn't work for finding text

For some reason the countif function does not work for me. Please help me out.

I try to search short words or letters. In the following example I have in a column (“A”) simple two letter words in each cell (below each other from row 1-6). Two of them have cc, but the function gives me 0.

aa

aa

cc

aa

cc

aa

=COUNTIF(A1:A6,‘cc’)
gives me “0”

Now the things get even more funny! If I copy the content into B column, then the function in A (cell A7) suddenly shows “2”, although the range still indicates only A1:A6. Why does it search in the B column? The same equation under “B” column in cell B7 shows the right result.

aa aa

aa aa

cc cc

aa aa

cc cc

aa aa

2 2

To make things even more weird, if I copy the letters into C column, the same equation in column A gives again a different result! Now it shows a VALUE! error and the equations under B and C give 2.

I would be very grateful for advice. The equation seems to work fine with numbers, but not with text. Is this a bug in libreoffice? Is there an alternative function to use?

Try changing ‘cc’ by “cc”, the single quotes have different meaning for LibreO. They are used to find automatically as title of row or columns.

Confirmed.