You probably know that a terrific way to build meaningful wealth is to invest in strong and growing companies for the long term. That's why quality is so important. 

Still, when you find a very promising and growing company, you shouldn't necessarily dive in -- because you also need it to have an appealing price. Its valuation should be very attractive or at least reasonable -- otherwise you may buy at such a steep valuation that the stock will be as likely to retreat as to advance.

Here are three promising companies whose stocks seem to have gotten ahead of themselves.

Hershey

Hershey (HSY 0.75%) has been a sweet investment for many people, outpacing the S&P 500 over the past decade with an average annual total return of roughly 14% versus 12% for the benchmark index.

The company has grown over the years into a business recently valued at $56 billion, and it encompasses much more than those iconic chocolate bars in brown wrappers or Kisses in shiny foil. Its brands today include Reese's, Kit Kat, Jolly Rancher, Ice Breakers, SkinnyPop, Pirate's Booty, and Dot's Homestyle Pretzels.

Hershey's 2022 organic revenue grew 12% year over year, with earnings rising by double-digit percentages, too. That was due, in part, to inflation-driven price increases. The company expects revenue to grow by just single digits in 2023. (Organic revenue is derived from existing businesses and operations, excluding contributions from new acquisitions.)

Sadly, though, Hershey's shares don't look especially tasty at recent levels. Its forward price-to-earnings (P/E) ratio was recently about 27.5, well above its five-year average of 23.6. Its price-to-sales ratio of roughly 5.1, meanwhile, topped the five-year average of 4. For best results, it might be wise to wait for a pullback in price.

Stryker

Stryker (SYK -0.70%) may not be a familiar name to you, unless you spend a lot of time in the healthcare arena -- its name is emblazoned on countless hospital beds and stretchers, for example. That's just the tip of the iceberg, though: Stryker specializes in "innovative products and services in Medical and Surgical, Neurotechnology, Orthopaedics and Spine that help improve patient and healthcare outcomes."

The company has been growing at a good clip, too -- averaging annual total returns of 18% (with dividends reinvested) over the past decade. In 2022, organic revenue increased by nearly 10% over 2021, and the company is likely to grow in the years to come -- in part because it's investing to do so. It spent nearly $1.5 billion on research and development in 2022 and has more than 12,000 patents.

Stryker pays a dividend that recently sported a modest yield of 1% -- but it has bumped up its payout by an annual average of 10% over the past five years. Its stock doesn't appear to be bargain-priced, though: Its forward P/E is about 29, well above the five-year average of 24.6, and its price-to-sales ratio of 6 is above the five-year average of 5.4.

O'Reilly Automotive

O'Reilly Automotive (ORLY -2.29%) may be a low-key name, but it's been a rather flashy stock, averaging annual growth of more than 23% over the past decade -- enough to turn a $10,000 investment into more than $83,000. It has become a major auto parts supplier in North America, recently with close to 6,000 stores in 47 states and 42 stores in Mexico.

In 2022, O'Reilly celebrated its 65th anniversary and ended the year with Chief Executive Officer Greg Johnson noting, "We are very pleased to once again report a strong quarter, highlighted by 9% growth in comparable store sales and a 10% increase in diluted earnings per share."

There's a lot to like about O'Reilly, such as the defensive nature of the business. Cars will always need parts and repairs, no matter what the economy is doing -- and in a recession, there may be more demand, as people postpone buying newer cars and try to keep their older ones running.

The stock isn't cheap, though, with a recent forward P/E of almost 24, well above the five-year average of 21.1.

You might want to add one or more of these companies to your watch list -- or, if your own calculations and considerations suggest that they're fairly valued or better, buy some shares now.