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

What is the formula for calculating compound annual growth rate (CAGR) in Excel?
The concept of CAGR is relatively straightforward and requires only three primary inputs: an investments beginning value, ... 
What is the formula for calculating the debttoequity ratio?
Find out how to use this fundamental financial ratio to help assess a company's performance. 
What are some common traits of undervalued stocks?
There are a few basic factors found in companies that are worth more than their current stock price. 
What are the best indicators for evaluating technology stocks?
Technology stocks are often some of the most discussed stocks on the news. How can investors spot the company that will roll ...

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 ... 
Pension Risk Transfer
When a defined benefit pension provider offloads some or all ... 
FastMoving Consumer Goods (FMCG)
These are consumer goods products that sell quickly at relatively ... 
Amortization
1. The paying off of debt in regular installments over a period ...