Somebody forgot to tell consumer staples company General Mills (GIS -0.49%) that there's a bear market. The stock is up more than 20% over the past year, defying the broader indexes. So what's the deal? Or more importantly, is the stock still worth buying? Nobody wants to chase the train after it's left the station.

But don't worry, I'm here to help. General Mills is an outstanding dividend stock that yields almost 3%, but there's more here than passive income if you're a long-term investor. Roll up your sleeves and let's dig in.

Investors take comfort in General Mills

General Mills is a conglomerate that sells various food products to people and pets. Its brands are well-known in grocery stores, including Betty Crocker, Blue Buffalo, and a wide range of favorite cereal brands like Cheerios, Chex, and more.

It's no secret that the stock market is volatile these days -- investors and consumers are scared. Consumer sentiment is at its lowest point on record, going back more than 60 years.

US Index of Consumer Sentiment Chart

US Index of Consumer Sentiment data by YCharts.

Investors don't want to roll the dice on flashy technology companies or the supposed next best thing during tough times. Instead, they gravitate toward established, reliable companies. General Mills is a staple of pantries worldwide, and that has appeal right now.

Performance is backing that up

This sentiment is little more than wishful thinking without results. General Mills recently closed out its fiscal 2022 by reporting earnings for the quarter ended May 29. Revenue grew 8%, and organic net sales increased 13%, primarily driven by price increases. Meanwhile, General Mills combated double-digit inflation of costs. Pricing power kept the decline in gross profit margins at just 70 basis points, less than 1 percentage point.

Top-line growth, along with the pricing power to offset most of the cost inflation, led to non-GAAP earnings per share (EPS) growing 23% year over year to $1.12.  The company also raised its dividend by 6% and increased its share-repurchase program enough to lower outstanding shares by 2% to 3% in 2023. These actions signal a management team's confidence in the company's performance and resonate with shareholders, especially during these rocky market conditions.

A positive outlook with a reasonable price tag

General Mills has been on a roller coaster over the past decade. It made a company-changing leap into the pet foods category, buying premium food brand Blue Buffalo in 2018 for $8 billion. Today, the stock trades at a price-to-sales ratio (P/E) of just under 20, a slight premium to the stock's median P/E of 18 over the past decade.

GIS PE Ratio Chart

GIS PE Ratio data by YCharts.

However, investors should consider the company's positive outlook. It's spent the past couple of years reshaping its product portfolio. Analysts expect EPS growth to accelerate to between 7% and 8% over the next three to five years from the 5% average over the previous 10 years.

Remember, we're in a volatile market, and General Mills could cool down after its successful run over the past year. But if you're in the market for a quality dividend stock that can steadily create value over the years ahead, General Mills seems to fit the bill.