The price-earnings ratio (P/E ratio) of a stock is arrived at by dividing the market value of a single share by the current (or expected future) earnings per share. Importantly, P/E ratio is one of the most used metrics for valuing a company (and its stock).Another way of looking at it is that the P/E ratio is an indication of the amount (in dollars) an investor will have to pay for $1 in earnings.Related: THE ROLE OF EARNINGS IN SHARE PRICEFor ExampleSuppose a company had earnings over the past year of $2 per share. Also suppose the stock for this company was currently trading for $10 per share. By dividing the price of a share ($10) by the earnings ($2), you would arrive at a P/E ratio (also known as the ‘multiple’) of 5.If you bought a share of this company’s stock, you would – in effect – be paying $5 for $1 in earnings. ($10 for $2 in earnings). If earnings continued at this rate you would have made your $10 back in 5 years. Anything after that would be pure profit.Types Of EPSEarnings Per Share (EPS) is obviously a critical part of the P/E ratio. Most often it is derived from the last 4 quarters and helps create what is known as trailing P/E. Sometimes investors look at expected Earnings Per Share for the next 4 quarters. This creates what is known as the projected or forward P/E ratio.A less common variation uses the previous 2 quarters EPS plus projected EPS for the next 2 quarters. No matter which type of EPS are used, the P/E ratio arrived at can be compared to a previous P/E ratio using the same type of EPS or to another company in the same sector – as a way of helping investors decide which stock to buy (or sell).What It MeansWith the caveat that P/E ratio is only one element in comparing stocks, in very general terms a company with a high P/E ratio indicates that investors are expecting higher earnings growth in the future (and are willing to pay for that expectation).When a company’s stock reflects a low P/E ratio it can mean the company’s stock is undervalued or that the company is doing well compared to its past trends. Price-earnings ratio can also be used to standardize the value of one dollar of earnings throughout the stock market.Valuing A StockWhile P/E ratios are useful tools for valuing stocks, they are not the be-all-end-all of investing analysis. P/E ratios have significant limitations that range from discrepancies in accounting rules to inaccurate estimates of future growth – and everything in between.On way to use P/E ratios is to determine if a sector or industry is overpriced. When this happens the average P/E ratio of all companies in that sector are much higher than the historical average.Mostly, however, investors use P/E ratios to compare companies within an industry. If, for example, two companies are selling for $50 per share but one has a P/E ratio of 10 and the other a P/E ratio of 20, the company with the higher P/E ratio could be a lot more expensive (overpriced) than the one with a P/E of 10, which might be considered undervalued.Related: INSIDE THE BALANCE SHEETDon’t Be MisledDon’t think you can use P/E ratios alone to value stock and companies. People have made millions of dollars investing in eBay Inc. (NASDAQ:EBAYA), Amazon.com (NASDAQ:AMZNB) and Alphabet Inc. (NASDAQ:GOOGA) even though all 3 companies have traditionally extremely high P/E ratios.Earnings can be inflated by sales of assets or deflated by one-time charges. Potential, though hard to gauge, is an important element in the future value of a company and its stock. You can use tools like WooTrader and FinanceBoards to obtain and compare P/E ratios while also studying and researching various other important factors that help paint a picture of the underlying business that drives the price of a company’s stock. Or as Warren Buffett has often said, “growth and value are joined at the hip.”