First of all, remember that dividing by a fraction is the same as multiplying by the inverse fraction:
#\frac{p^2-11p+28}{2p} div \frac{p-7}{2p} = \frac{p^2-11p+28}{2p} \cdot \frac{2p}{p-7}#
Cross simplify common terms:
#\frac{p^2-11p+28}{cancel(2p)} \cdot \frac{cancel(2p)}{p-7} = \frac{p^2-11p+28}{p-7}#
You can also observe that #p^2-11p+28# is a quadratic equation. If we find the two roots #p_1# and #p_2#, we may write #p^2-11p+28 = (p-p_1)(p-p_2)#.
We can avoid the quadratic formula in this case: if the quadratic coefficient is #1# (which is our case), the equation can be read as
#p^2-sx+p#
where #s# is the sum of the solutions and #p# is their product. So, we're looking for two numbers which sum up to #11# and give #28# when multiplied. These numbers are clearly #4# and #7#. So, you have
#p^2-11p+28 = (p-4)(p-7)#
The fraction becomes
#\frac{p^2-11p+28}{p-7} = \frac{(p-4)cancel((p-7))}{cancel(p-7)} = p-4#