I've typed your exact formulas into my version of Excel (365) and don't get the same problem. If I use the wildcards it returns yes, if not, it returns no - doing an exact search.
In your image we can't see all the rows. Your countif is for lines 2 through to 7. Is it possible p1234 is appearing further down in the list (say line 6 or 7)?