Procter & Gamble (PG 0.03%) just gave shareholders some more reasons to celebrate. The consumer staples giant said on Wednesday morning that it gained market share even following booming demand over the past two years. Profitability is benefiting from rising prices, and cash flow is soaring too.

The operating update put P&G on a stronger growth track than most investors expected. And the earnings picture is brightening despite surging costs.

Let's take a closer look at three reasons why the stock looks even more attractive today.

Person shopping for detergent.

Image source: Getty Images.

1. P&G is beating sales targets

Investors had been looking for P&G to post just a 3% sales uptick, which would have come on top of the prior year's 8% spike. Instead, the company reported 6% higher organic sales, with each of its five core divisions growing year over year.

The fabric and home care segment, home to brands like Tide detergent, was a standout. The healthcare niche also received a boost from higher demand for flu symptom management that's likely tied to the latest COVID-19 case surge.

But P&G achieved a surprisingly strong balance across the portfolio of higher prices and rising sales volumes. "We delivered very strong top-line growth," CEO Jon Moeller said in a press release.

2. P&G is dealing with cost increases

P&G did face challenges around rising costs. In fact, gross profit margin dove by 4 full percentage points due to soaring prices for raw materials like plastics and higher freight costs. Yet the company offset those pressures with savings in other parts of the business and by hiking prices. It also helped that consumers are still spending aggressively on premium products like Tide Pods.

Bottom-line profitability fell by 2.5 percentage points, translating into core earnings-per-share growth of just 1%. That result was better than expected. It also implied that P&G finally has a grip on inflation, which is set to pressure earnings by over $2 billion during this fiscal year.

3. More cash returns

The new annual outlook was packed with good news for investors. P&G now sees sales growing by between 4% and 5% in 2022 compared to its previous target range of 2% to 4%.

We'll get a better idea about how that translates into market share growth after rival Kimberly-Clark reports its earnings in late January. However, P&G appears to be winning more than its fair share of consumer staples categories like home care, baby care, and beauty products.

Executives also confirmed their outlook for earnings that calls for core profit to rise by between 3% and 6%. Yes, that equates to a modest drop in profitability this year. But investors were worried about bigger declines thanks to inflation and supply chain challenges.

The cash flow forecast received an upgrade, which means P&G has more resources it can invest in the business even while spending aggressively on dividends and stock buybacks. Management now expects to return between $17 billion and $18 billion to shareholders through these channels in 2022, up from the prior goal of $15 billion to $16 billion.

The high end of that forecast would mark just a modest step backward from last year's $19 billion of cash returns. That success implies that P&G is avoiding the type of growth and earnings hangover that Wall Street had feared after demand surged over the past two years. It should also amplify total returns for investors who simply hold the stock over the long term.