The Price-to-Earnings ratio (PE) that you are willing to pay for a company should depend on three things: the growth rate of the company, the time frame of your investment and your expected return.
If you are happy with 5% annual return on investment (ROI), assuming either the company pays out 100% of it’s earnings in dividends, or you perceive the value to be retained in the company to be part of your return, a PE of 20 is what you should strive for (5% being the whole company divided into 20, or 100 / 20 = 5).
If a company has zero growth and this is always true, a PE of 20 will eternally get you your 5% ROI. But if the company is growing, and you pay a PE of 20, then each year the PE will improve on the former year (inflation excluded). This is where the other part of my statement comes into play, whereby the growth rate and time frame of your investment will effect the PE you need to pay to get a PE of 20 within your given time frame.
In other words, if you are happy with a PE of 20, but don’t mind waiting a year for the price you paid to become a PE of 20 after a few years growth, you would be willing to pay a PE of greater than 20 to get a better return in years to come.
For example, if you pay $100 for a share of a company that has $4 worth of Earnings Per Share (EPS), you’ve paid a PE of 25 (100 / 4 = 25). If that company grows EPS to $5, you effectively paid a PE of 20 (100 / 5 = 20). If you’re investment time frame is a few years, you might be happy to wait for the PE to take a year to get to an acceptable level, especially knowing that years after, with more growth, your effective PE would be much less than 20.
Here are 3 graphs I’ve created showing how PE changes over time based on an initial purchase at a specific PE for companies with different annual growth rates. The different graphs show how a higher purchase price extends the time frame for the investment to become acceptable.



This should help calculate a good PE to buy shares at, based on your expected ROI, time frame and the growth rate of the company.