Warren Buffett has talked of preferring to buy into a great company at a good price than a good company at a great price. That points out how important a company's quality is to him, but it doesn't mean that price doesn't matter. His company recently sported close to $150 billion in cash and cash equivalents -- if he didn't insist on only paying good or reasonable prices for stocks and companies, he'd have spent much of that sum by now.

Here are three companies that have been serving their investors very well, but their prices may have gotten ahead of themselves lately.

A concerned person with spectacles is looking at the camera.

Image source: Getty Images.

1. Nvidia

Nvidia (NVDA 4.35%) is a graphics processing unit (GPU) maker that has grown into a behemoth, with a recent market value near $750 billion. (Intel, by comparison, was recently valued near $200 billion.) Over the past decade, Nvidia's stock has soared more than 8,000% (without reinvesting dividends) -- that's more than 55% annually, on average.

Nvidia has a lot going for it, and it's reasonable to expect it to keep expanding and growing. It's already a powerhouse in gaming, and it's also active in other arenas, such as artificial intelligence, robotics, cloud computing, autonomous driving, and 5G. Its overall growth rate is robust, with third-quarter revenue popping 50% over year-earlier levels, with data center revenue up 55% and gaming revenue up 42%. CEO Jensen Huang noted: "Demand for NVIDIA AI is surging, driven by hyperscale and cloud scale-out, and broadening adoption by more than 25,000 companies."

Many expect unrelenting growth from Nvidia over the coming years, but still, it's fair to worry that the stock is overvalued at this point. Check out some of its recent valuation metrics vs. their five-year averages:

Metric

Recent

Five-year Average

Price-to-Earnings (P/E) Ratio

93.1

56.7

Forward P/E Ratio

58.8

39.7

Price-to-Sales Ratio

31.5

16.0

Source: Morningstar.com. 

2. Home Depot

Home Depot (HD 0.22%) has been growing robustly for decades and recently boasted 2,317 locations in all 50 states while employing about 500,000 people. Its market value recently topped $430 billion, and despite that massive size, it's still been growing briskly. In its third quarter, revenue rose nearly 10% year over year, while earnings per share jumped 23%.

The company has successfully secured inventory in the face of supply chain blockages, which bodes well for minimally disrupted operations. However, if demand drops due to continued or new pandemic issues, or perhaps due to housing market changes, it may be left with considerable assets tied up in inventory.

Home Depot is firing on many cylinders and has a lot going for it. Its recent valuation appears rather lofty, though. Check out the numbers below:

Metric

Recent

Five-year Average

Price-to-Earnings (P/E) Ratio

27.8

23.2

Forward P/E Ratio

26.7

21.7

Price-to-Sales Ratio

3.0

2.2

Source: Morningstar.com. 

3. Sherwin-Williams

Sherwin-Williams (SHW 1.08%) is an underappreciated gem of a stock. Consider that over the past 20 years, its shares have grown in value by more than 4,000% (about 20.4% annually, on average) -- and that's without reinvesting dividends. It's a paint and coatings specialist, not a much-hyped fintech stock or a burgeoning cloud-computing concern.

The company has long been a solid dividend payer, with 43 consecutive years of dividend increases -- most recently a 23% hike, in February. The dividend yield was recently only 0.63%, but that's partly due to the stock rising so much. (Remember that a dividend yield is simply a stock's current annual dividend payment divided by its current stock price -- so as a stock's price rises, its yield will drop, and vice-versa.)

Sherwin-Williams traces its history way back to 1866 and has grown to encompass more than 5,000 company-operated stores and brands, including Sherwin-Williams, Valspar, HGTV HOME by Sherwin-Williams, Dutch Boy, Krylon, Minwax, Thompson's Water Seal, and Cabot, among others. There's no reason to think it won't continue growing and selling a lot of paint and coatings, but it's also fair to see the stock as having gotten ahead of itself.

Metric

Recent

Five-year Average

Price-to-Earnings (P/E) Ratio

47.4

31.4

Forward P/E Ratio

33.7

24.5

Price-to-Sales Ratio

4.7

2.9

Source: Morningstar.com. 

Consider waiting

Nvidia, Home Depot, and Sherwin-Williams are terrific companies with wonderful track records of stock growth. They've made a lot of money for millions of shareholders. Their stocks offer little margin of safety right now, though -- indeed, they're priced as if they will grow at breakneck speed without encountering any speed bumps.

To minimize risk, consider adding them to your watchlist, waiting for a pullback before buying into the companies.