COUNTIF not working as expected

LibreOffice 25.8.1.1 macOS 13.7.8

I have a spreadsheet with rows of contacts. I want to check that there are no email addresses in this list (column D) that are in another list of email addresses (column J).

I do this regularly and it always works. I have the formula =COUNTIF(J$2:J$165,D2) in the first row in column I. This works as the first contact email address is in the list. I then fill (cmd + D) from the first to the last row in the contact. The criteria range is changing as it should, but the formula is not evaluating correctly as all rows in column I are 0, even if they should be 1.

If I directly type the formula into the cell in column I =COUNTIF(J$2:J$165,D22) or even if I paste it, it works correctly, just not if I fill. I have never had this issue before and I can’t work out what is happening.

Also doesn’t work if I pull the cell corner down to fill either.

Check Menu / Data / Calculate / AutoCalculate

1 Like

I started from scratch by opening the file again and it was fine. No idea what was wrong.