The formula does not respond as expected

The formula does not respond as expected

imported a workbook from LIbreOffice. In the first sheet there are formulas which all give the expected result except this one
The formula in cell B41 is as follows: =IF(B46="";"";IF(COUNTIF(B6:B36;"PP|PM")=B46;"";COUNTIF(B6:B36;"PP|PM) ")-B46)).
Searches for the presence of "PM" or "PP" in the desired range, compares it with B46 = 1 and then reports (in B41) the result
The value "PP" is present in the range but the result in B41 = -1 instead of ""
In LibreOffice to overcome this problem there is the "Enable regular expressions in formulas" option. Is there something similar in Zoho or is the formula wrong?