Hershey (HSY -0.53%) is one of those stocks that I've always kept on my wish list but have never had the opportunity to buy. Simply put, it was always too expensive for my taste. But a 33% price drop since May brought the stock's yield up to 2.5% or so, which is toward the higher side of its historical range. I jumped at the opportunity even though the stock has been cheaper before. Here's why.

Paying a fair price for a great company

There are two competing thoughts that drive much of my investing. One is from Benjamin Graham, author of The Intelligent Investor. To paraphrase him, even a great company can be a bad investment if you pay too much for it. In other words, value matters. 

A hand drawing a scale showing price vs. value.

Image source: Getty Images.

Juxtaposed against that investing ethos is Wall Street legend Warren Buffett, who trained under Graham. To summarize Buffett, you want to buy great companies at fair prices and hold for the long term. Basically, value is important, but it's equally important -- if not more important -- to own good companies. 

My approach to finding good companies leans heavily on dividends, which comes from Graham. In The Intelligent Investor, he suggests that investors look for companies that have paid consistent dividends for at least two decades. I add to that a yield that is toward the high end of the stock's historical yield range. 

I think Hershey fits the bill for both Graham and Buffett, though it isn't as cheap as it has been in the past. I could have waited to see if the stock got even cheaper, but I didn't want to miss the opportunity to buy shares of a company I've long wanted to own by trying to perfectly time my entry point. I think it would be better to just add more, averaging down my cost basis, if it continues to fall. 

Now is my time to buy Hershey

So the first thing about Hershey I like is its area of expertise. Selling confections, most notably chocolate, is a good business because people love sweets. The company's long history of success is clear evidence of that. While its revenue and earnings don't go up every single year, they have trended mostly higher for a very long time. The dividend, too, has trended mostly higher, with annual increases in each of the last 14 years. (Note that the dividend didn't get cut 15 years ago, it just didn't get increased coming out of the Great Recession.)

HSY Dividend Per Share (Annual) Chart

HSY Dividend Per Share (Annual) data by YCharts

That said, Hershey's business is largely domestic, where it has a dominant position in confections. This is a mature market and it has to fight for market share. But it has been working to grow its foreign business and has recently begun to push into salty snacks. Both of these moves offer long-term growth potential. I see this as a company with a strong foundation and attractive opportunities for growth.

Right now, investors are downbeat on Hershey stock because of rising cocoa prices and the fear that weight-loss drugs will reduce demand. Commodity prices have always been volatile, so I'm confident that Hershey will muddle through on that front. Weight-loss drugs are a big topic on Wall Street and could be a major issue for companies like Hershey, but I find it hard to believe that human beings will suddenly swear off treats forever. Thus, I think the stock decline is probably an overreaction to temporary issues. 

HSY PE Ratio Chart

HSY PE Ratio data by YCharts

The yield is my first value screen. At around 2.5%, it is toward the higher side of the historical yield range, though not at the highest point. I would love to buy great companies only at their highest historical yields, but that type of perfection just isn't a realistic expectation. And if I waited, I might have missed getting into a company I've long admired. However, backing up that historically elevated yield are the price-to-earnings, price-to-sales, price-to-book value, and price-to-cash flow ratios, which are all below their five-year averages. So Hershey does look attractively priced in many ways.

I'd rather be about right than miss the opportunity

So, as I weighed the pros and cons, I decided that it was better to buy a great company at a price that seemed reasonably cheap (though not dirt cheap) than miss the chance to own Hershey for the long term. The stock could very easily go down more, and if it does, I'll probably add to my position, averaging down my purchase price. But if it goes up and I hadn't bought it, I would have kicked myself for missing the opportunity (I've done that one too many times) to get what I consider a great company at a fair price.