The priceearnings ratio (P/E ratio) is a valuation measure that compares the level of stock prices to the level of corporate profits, providing investors with a sense of a stock’s value. To calculate a company’s P/E ratio, use the following formula:
P/E ratio = price per share / earnings per share (EPS)
Where EPS = earnings/total shares outstanding
As long as a company has positive earnings, the P/E ratio is calculated this way (a company with no earnings, or one which is losing money, has no P/E ratio). The stock price per share is set by the stock market, and the earnings per share value will vary, depending on the company’s financials and which earnings variant is used. Typically, EPS is taken from the last four quarters (trailing P/E; referred to as TTM for trailing twelve months), but it can also be taken from the estimates of earnings expected over the next four quarters (forward P/E) or some other variation. As a result, a company will have more than one P/E ratio, and investors must be careful to compare the same P/E ratio when evaluating different stocks.
To determine the P/E ratio, investors can divide the stock price by EPS. For example, CocaCola Co (KO) on June 18, 2014 traded at $41.56 per share with an EPS (TTM) of $1.87, so the P/E ratio would be:
 Stock price ($41.56) / earnings per share ($1.87) = 22.22
This essentially means that investors are willing to pay $22.22 for every dollar of earnings that KO has. For comparison, Pepsico Inc (PEP) on the same day traded at $88.90 per share with an EPS (TTM) of $4.43 and a P/E ratio of 20.31. The average P/E ratio for companies in the Beverage sector is about 20.26, and, historically, the average P/E ratio for the broad market has been around 15. KO, therefore, has a higher P/E ratio than both the sector and broad market average, as well one of its competitors, PEP. This higher P/E ratio might mean that investors will expect higher earnings growth in the future compared to the overall market. The P/E ratio is only one valuation measure, however, and investors would have to dig deeper before making any investment decisions.
RELATED FAQS

How can the pricetoearnings (P/E) ratio mislead investors?
A low P/E ratio doesn't automatically mean a stock is undervalued, just like a high P/E ratio doesn't necessarily mean it ... 
What is the Double Exponential Moving Average (DEMA) formula and how is it calculated?
Discover the equation for double exponential moving average, or DEMA, and learn how it is calculated for a better understanding ... 
What is a good interest coverage ratio?
Learn the importance of the interest coverage ratio, one of the primary debt ratios analysts use to evaluate a company's ... 
What is a bad interest coverage ratio?
Understand how interest coverage ratio is calculated and what it signifies, and learn what market analysts consider to be ...

PriceEarnings Ratio  P/E Ratio
A valuation ratio of a company's current share price compared ... 
Best's Capital Adequacy Relativity (BCAR)
A rating of an insurance company’s balance sheet strength. Best’s ... 
Deferred Tax Asset
A deferred tax asset is an asset on a company's balance sheet ... 
Earnings Per Share  EPS
The portion of a company's profit allocated to each outstanding ... 
Return On Investment  ROI
A performance measure used to evaluate the efficiency of an investment ... 
Working Capital
This ratio indicates whether a company has enough short term ...