The formula for calculating the P/E ratio is as follows:
P/E Ratio = Market Value per Share ÷ Earnings per Share
The P/E ratio is used to calculate the earnings of different company stocks and indicates a company's performance over 12 months.