The market has hit a rough patch this year, with the S&P 500 down by about 20% in 2022. However, even when challenges arise, certain stocks do well. One such stock is Kroger (KR 0.29%), which has gained about 6% during this span. While that may sound underwhelming, consider that performance trounced the overall market.

Over the last three years, Kroger's stock has more than doubled, increasing by about 116%, almost four times the S&P 500's gain.

While it's tempting to hop on the bandwagon, you shouldn't blindly invest in a stock merely based on past success. To determine whether or not Kroger's shares still present a good opportunity, it's time to delve deeper into the company's valuation and growth prospects.

A grocery store worker helps a customer find food in an aisle.

Image source: Getty Images.

Valuation

You can use various metrics to evaluate the price of a stock. While it's tempting to look at the share price, you should examine objective measures such as the price-to-earnings ratio (P/E). You can use this metric to compare how much investors are willing to pay for a company's earnings and compare that number historically and to other companies in the industry.

Kroger's rapid stock price advance has meant that the equity now trades a P/E multiple of over 16 compared to under 10 times in 2019. It's also important to compare Kroger's P/E to similar companies. Albertsons Companies, a food and drug retailer, sells at an 18 multiple while Walmart has a 26 P/E. Hence, while the stock has become relatively more expensive, it sells at a discount to its peers.

The key question becomes whether Kroger's stock warrants this higher relative valuation compared to a few years ago based on its growth prospects.

Prospects

Kroger has grown to become a large food, pharmaceutical, and gas retailer. The retailer sells basic, everyday items, so it's natural to expect a steady business no matter what's going on in the economy. This certainly helped the company during the pandemic. 

Consumers have a lot of options, though. But pushing its "leading with fresh and accelerating with digital" has been a powerful combination to remain competitive with the likes of Amazon and Walmart. For its fiscal first quarter (ended May 21), same-store sales (comps) excluding fuel rose by a solid 4.1%. Kroger's adjusted operating profit was $1.6 billion, 16.4% higher than a year ago.

Management gave more optimistic guidance for this year. It expects comps to increase by 2.5% to 3.5%. Previously, the company called for a 2% to 3% comps increase.

Like other retailers, Kroger has been dealing with higher supply chain costs. The company does have a vertically integrated supply chain that helps mitigates them. However, while the company increased this year's adjusted operating profitability expectations by $100 million to a range of $4.3 billion to $4.4 billion, the revised figure remains relatively flat from fiscal 2021's $4.3 billion.

Kroger has a lot going for it. It's been generating consistent sales growth, and its profit has been increasing. However, with a higher stock valuation and a cautious operating income outlook for this year, I'd hold off on purchases right now.