PepsiCo (PEP -0.62%) just announced another strong earnings report, which Wall Street promptly shrugged off. The snack and beverage company beat sales expectations and raised its outlook for a second straight time while boosting profitability in the process. And yet the stock remains an underperformer so far in 2023.

Is Wall Street right to be avoiding this business right now, or is PepsiCo a compelling buy at these prices? Let's dive right in.

The latest growth

There wasn't much to complain about in Pepsi's mid-July earnings update. Organic sales were up a surprisingly strong 13%, marking only a modest slowdown from the prior quarter's 14% surge. Through the first half of the year, that metric is sitting at a heathy 14%. "We are pleased with our performance for the second quarter as our business momentum remains strong," CEO Ramon Laguarta said in a press release.

Looking deeper into the results, Pepsi again relied mainly on price increases to boost the business. Volume fell 3% across the global food business and declined by 1% in beverages. But parts of the portfolio stood out as big winners. The Frito-Lay snack segment in the U.S., for example, saw a 14% organic sales increase as volume inched higher by 1%.

Profits and earnings

PepsiCo's profitability picture is brightening, too, although investors will need to be patient on this score. Cost growth has slowed in recent weeks, and price increases are helping boost the bottom line. These wins helped second-quarter gross profit improve to $12.2 billion from $10.8 billion a year ago. Operating income expanded even faster, jumping to $3.6 billion from $2.1 billion.

PEP Operating Margin (TTM) Chart

PEP operating margin (TTM) data by YCharts. TTM = trailing 12 months.

Overall, operating margin seems to have stabilized after falling for several quarters. Pepsi is getting additional help in this area from its snacks business and its push into more nontraditional beverage niches like energy drinks. Investors are hoping all of these trends will help lift operating margin back up toward 16% of sales from its current perch at closer to 14% of sales.

Buy this stock

Pepsi lifted its sales outlook for a second consecutive time and now intends to generate 10% organic growth, up from 8% last quarter and a projected 6% at the start of the fiscal year. The earnings picture is brightening as well, with core profits likely to grow 12% compared to the prior goal of 9%.

It's hard to square those improving results with Pepsi's stock valuation. Shares are underperforming the market so far in 2023, and the valuation has remained stuck at around 3 times revenue. The spice and condiments specialist McCormick, by comparison, is priced at 3.5 times revenue.

PepsiCo shares looked attractive even before this earnings update, but its faster growth profile makes the buy decision even easier. It's always possible that the company will struggle for a period if a recession strikes. But the snack and beverage giant is winning market share and steadily boosting profitability. These successes should help deliver good returns for investors who hold the stock in a diversified portfolio.