PE Premium vs Sector is calculated as the percentage difference between the stock PE ratio and the sector PE ratio.

As can be seen from the table above, stock A has a higher PE ratio than the sector average which results in a positive output. When the output is positive it is said that the stock is trading at a premium to the sector. In stock B’s case the output is negative, indicating that the stock’s PE ratio is lower than the sector’s PE ratio. In such a scenario it is said that stock is trading at a discount to the sector.   

A company might be trading at discount to the sector either because the stock’s future earnings potential are low or because market has not noticed its earnings potential and hence there is a temporary pricing mismatch.

Such a situation might present a genuine buying opportunity of the stock, however it is important to ensure that the market has not correctly understood B’s earning potential. If market has ignored B because of poor earnings or bad management practice, it is better to ignore the same in spite of relative cheapness.