I seek to count how many unique values from column A exist that match a value from column P-- so that I can tell how many unique inventory ID numbers exist that match inventory codes for different criteria.

I have tried
=countifs('July Orders'!$A:$A,(Match('July Orders'$A:$A,'July Orders'$A:$A,0)),'July Orders'!$P:$P,"01*")

but that doesn't work.

Any advice would be greatly appreciated!