There aren't all that many companies that investors should feel comfortable owning for decades. But when great companies go on sale, it pays to step up and buy. Right now it looks like investors are getting a decent deal on iconic food makers Hormel Foods (HRL -0.30%) and Kellogg (K -0.19%). Here's why you might want to buy and hold these two companies.

Working through the problems

Hormel's dividend yield is roughly 2.3% today. That doesn't sound huge, but it is toward the high side of the company's historical yield range. Since this food maker is a Dividend King with 56 years of annual dividend increases under its belt, dividend investors should really take note. All the more so given that the annual dividend increase over the past decade was a hefty 14%.

So why does Hormel look historically cheap? The answer is twofold. First, the world is dealing with a major inflation spike. Thus, the company's costs are rising and investors are concerned that profit margins will get squeezed. Hormel is doing what it always does in this situation: It is increasing prices and looking for ways to cut costs. It usually takes time to do all of that work, so in the near term investors' worries are justified, but over the long term this will likely be a minor blip.

The other issue today is the avian flu, which looks like it could have a material impact on the company's Jennie-O Turkey business. Avian flu isn't new, and the company is working to deal with the disruption to its business. Like inflation, this could impact the foodmaker's near-term results, but it is unlikely to be a lingering long-term issue. 

All in, Hormel's incredible dividend history suggests that it is a well-run company that knows how to handle adversity. Right now it looks like some investors are getting too caught up in short-term issues, opening up an opportunity for investors who think in decades and not days.

Cereal blues in a changed business

Iconic consumer staples company Kellogg is working through material problems in its namesake cereal business. They are very real problems -- the company faced a strike across all of its U.S. cereal production facilities in late 2021 and had one plant shut down because of a fire. In the first quarter, the company's cereal problems led to a year-over-year sales decline in its North American business. This is a notable headwind that probably won't be resolved until the second half of 2022.

But Kellogg has revamped its operations in recent years, so that cereal is actually just a small portion of its North American business. Snacks are a much more important long-term growth driver in North America, while fast-growing emerging markets are notable outside of the company's home market. Both of those businesses are doing just fine, helping to push Kellogg's organic sales up roughly 4% in the first quarter despite the cereal headwinds. 

Meanwhile, as the cereal business gets back on track, it will become less of a drag on overall performance. Inflation-related price hikes will be the only lingering problem, but even that, as noted above, is manageable with price hikes over time. In fact, given its overall solid start to 2022, Kellogg actually increased its organic growth target for the year from 3% to 4%. That's not bad for a stock offering a historically high 3.3% dividend yield backed by 18 consecutive annual dividend increases. If you can look beyond the next six months or so, you might want to get to know Kellogg today.

Nothing is perfect

Even great businesses move along a sine curve, oscillating between good times and bad times. If you can think long term, the best time to buy is when great companies like Hormel and Kellogg are dealing with temporary headwinds. Both are worth a deep dive today if you are looking for a reliable dividend stock to own for the next two or three decades.