Investors have pushed the shares of Hershey (HSY 0.58%) up 17% over the past year, a span over which the S&P 500 index has fallen around 13%.

That's impressive outperformance, with the company's fourth-quarter 2022 earnings release putting an exclamation point on why Wall Street is so bullish on Hershey. That said, the company thinks 2023 will be a good year, but perhaps not quite as good as 2022. 

A strong year

For all of 2022, Hershey achieved organic growth of 12%. That's a very good number, but the world has faced a swift rise in inflation. Rising costs for ingredients, transportation, and employees have resulted in consumer staples companies hiking prices as an offset. 

A person putting their hands up as if to say stop or slow down.

Image source: Getty Images.

Increasing prices is a delicate maneuver because higher prices can lead to consumers trading down to less-costly options. In this scenario, the benefit of price increases often offsets the impact of a volume decline, which is good. But the volume decline highlights that a company's pricing power has limits. 

Pricing accounted for 8 percentage points of Hershey's year-over-year organic sales growth. The remaining 4% was the result of a volume increase. That's the exact opposite of what you might expect as a food maker increases its prices and shows that Hershey appears to have material pricing power. Notably, its candies not only have loyal customers, but they are, even at a slightly higher price, still an affordable luxury. 

In the end, 2022 proved why investors are so fond of Hershey today: It is executing at an impressive level.

Slowing down

While 2022 was, overall, a very good year, the fourth quarter's organic sales growth needs to be taken into account. Notably, organic sales in the final stanza of the year were 10.7%, still strong but a slowdown from the full-year result. Price accounted for 8.5 percentage points of the advance, with volume at 2.2 percentage points. Frankly, it's hard to complain about either of these figures, but investors shouldn't ignore the fact that the benefit from volume was nearly cut in half.

In other words, Hershey may be getting to the point where its pricing power has been depleted. That's not to suggest that volumes will suddenly plunge, but that investors probably shouldn't project into the future the results from the recent past (a fairly common occurrence among investors). Also, Wall Street might take a less sanguine view of the situation here if Hershey's volume results soften further, which is exactly what the company is calling for.

Looking out to 2023, the company's guidance suggests that volume will be flat to slightly lower. Price increases are expected to more than offset any potential volume decline, leading to a total organic sales increase of between 6% and 8%. In the end, assuming the company lives up to its projections, that's still a very good result and shows just how strong the company's brands are. But it is certainly not as good as the performance in 2022.

HSY Dividend Yield Chart

HSY Dividend Yield data by YCharts

This brings the story to valuation. Hershey's price-to-earnings, price-to-sales, price-to-cash flow, and price-to-forward earnings ratios are all above their five-year averages. These traditional valuation tools clearly suggest that the stock is richly priced today.

The dividend yield, an alternative way to assess valuation, is 1.6%. That's near the low end of the stock's historical yield range, which also hints that the shares are on the expensive side right now. Value-oriented investors will definitely want to stay on the sidelines.

Proceed with caution

Growth-oriented investors looking at the consumer staples space will likely find Hershey's strongly performing business attractive in the current (and difficult) business environment. However, it is important to recognize the slowdown in volume that's taking shape and the impact that will have on organic sales growth.

Wall Street is currently taking a glass-half-full view of things, but it could quickly shift to a glass-half-empty take when volume results soften further, as the company is clearly telegraphing. A cautious approach is probably warranted right now, given the rich valuation being afforded to Hershey's stock.