Marked item codes include a real asterisk. A broad wildcard would also count similar unmarked codes. Use a tilde in the criterion to ask for the character itself.

Test marked codes alongside lookalikes

Put A*12, A112, B*07 and B007 in A2:A5. Enter:

=COUNTIF(A2:A5,"*~**")

The result should be 2. The ~* in the middle matches one actual asterisk. The outer stars allow any text around it.

A*12 and B*07 contain an asterisk. A112 and B007 do not.

Illustrated test range. The expected count is two.

Check a marker at the end of a code

Add C14* and expand the range. The count should become 3. Add a code without a marker and confirm the count stays at 3. If you only need cells that contain a single asterisk with nothing else, use ~* without the outer wildcards.

The middle tilde and star match the literal character, while outer stars allow surrounding text.

Illustrated criterion. Keep the escape directly before the asterisk.

Microsoft’s COUNTIF wildcard rules