...
OST P4 has ~70% pen chance against Sherman/Cromwell at range 20, it's 65% the other way around. The bigger the range, the better the P4s perform, at lower ranges P4 and Sherman/Cromwell become pretty much similar (all calculated with "my" penetration stats of Sherman).
...
Now try to do similar calculations at rear/side armor and you will that PzIV loses any advantage that does not require to flank the enemy vehicle since rear hit can occur when moving parallel.
But that is not the problem.
...
We should compare pen chances against a certain target, for example against other stock mediums.
...
The problem is not PzIV performance vs other mediums but the fact the allies have little reason to built mediums in the first place.
To make thing even worse most of the allied TDs have chance near 100% to hit and penetrate the PzIV at range 60, completely shutting it down.
Finally the PzIV is nearly obsolete once allied premium, heavies and super heavier appear.