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 demand and supply prevalent in 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 EPS; 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 EPS) 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 April 12, 2017 traded at $42.90 per share with an EPS (TTM) of $1.49, so the P/E ratio would be:
P/E ratio for CocaCola = Stock price ($42.90) ÷ earnings per share ($1.49) = 28.79
This essentially means that investors are willing to pay $28.79 for every dollar of earnings that KO has.
For comparison, Pepsico Inc (PEP) on the same day traded at $113.11 per share with an EPS (TTM) of $4.36 and a P/E ratio of 25.94.
The average P/E ratio for companies in the Beverage sector is about 31.11, and, historically, the average P/E ratio for the broad market is around 26.4 as of 2017. KO, therefore, has a lower P/E ratio than its sector and a higher ratio than the broad market average and PEP.
The company's P/E ratio might mean that investors will expect higher earnings growth in the future compared to its competitor, Pepsico, and 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.

What does the forward p/e indicate about a company?
Explore the forward price to earnings ratio and learn its significance and how it compares to the traditional price to earnings ... Read Answer >> 
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 ... Read Answer >> 
What is the average pricetoearnings ratio in the banking sector?
Explore the price/earnings ratio in regard to the banking industry and learn what the average P/E ratio is for most banking ... Read Answer >> 
Stocks with high P/E ratios can be overpriced. Is a stock with a lower P/E always ...
The short answer? No. The long answer? It depends.The pricetoearnings ratio (P/E ratio) is calculated as a stock's current ... Read Answer >> 
What is an alternative ratio to forward p/e?
Discover the most commonly used alternative equity evaluation ratio to the forward P/E ratio, and the relative advantages ... Read Answer >>

Investing
Can Investors Trust The P/E Ratio?
The P/E ratio is one of the most popular stock market ratios, but it has some serious flaws that investors should know about. 
Investing
Comparing the P/E, EPS And Earnings Yield
Here are three ratios that help investors value stock returns. 
Investing
Getting On The Right Side Of The P/E Ratio Trend
Buying at the right time is crucial, but how do we know when that is? 
Investing
How Do I Calculate the PriceEarnings Ratio?
If Apple is trading at $108.73 per share, and its trailing twelve months' EPS is $6.45, calculate the P/E ratio as... 
Investing
How To Use The P/E Ratio And PEG To Tell A Stock's Future
While the pricetoearnings ratio is commonly used for assessing stock prices, the price/earningstogrowth ratio offers forecasting advantages that investors need to know.

P/E 30 Ratio
The pricetoearnings (P/E) ratio is the valuation ratio of a ... 
Forward Price To Earnings  Forward P/E
A measure of the pricetoearnings ratio (P/E) using forecasted ... 
Trailing PriceToEarnings  Trailing P/E
The sum of a company's pricetoearnings, calculated by taking ... 
Ratio Analysis
A ratio analysis is a quantitative analysis of information contained ... 
Price/Earnings To Growth  PEG Ratio
Price/Earnings to Growth (PEG) is a stock's price to earnings ... 
Earnings Yield
The earnings per share for the most recent 12month period divided ...