It is suggested to add two auxiliary columns, enter all stock names in column S and enter formulas in T 1:
=COUNTIF(B:P,S 1)
Copy the formula to the corresponding row.
Select two columns of ST, and sort by T column in descending order.