Check out the latest Procter & Gamble earnings call transcript.

The stock had been down by over 20% at one point in 2018, but Procter & Gamble (NYSE:PG) shares raced back to finish the year roughly flat. That rally put the consumer goods titan comfortably ahead of the broader market's 6% decline last year, with returns that beat rivals like Kimberly-Clark (NYSE:KMB) and Unilever.

Let's look at where things went right for P&G, and whether the company can keep rallying into 2019.

A woman shopping for home cleaning supplies.

Image source: Getty Images.

Setting the stage

It helped that investors had such low expectations for the stock coming into the year. The owner of global hit brands like Tide and Pampers lowered its targets for organic sales growth in late 2017 to mark a second straight year of surprisingly weak revenue. P&G's new, slimmer portfolio wasn't delivering the faster expansion pace that executives hoped it would, and core franchises like Gillette were losing market share as well. All of this bad news contributed to a shareholder revolt that brought an activist investor onto the board of directors against management's recommendations.

The news didn't get much better in the early part of 2018. P&G's fiscal first-quarter report showed just a 1% revenue uptick, as consumers gravitated toward digital sales and value-based brands. "The ecosystems in which we operate around the world," CEO David Taylor said in a late-April press release, "are being disrupted and transformed."

A rebound years in the making

P&G's next earnings report, in late July, showed weak sales growth and more evidence of spiking commodity costs. However, its market-share trends improved. Crucially, the company issued a bold forecast for the new fiscal year that called for sales growth to double or triple from the prior year, to reach between 2% and 3%. P&G said these gains would come even as the company rolled out aggressive price increases across its portfolio.

For a change from recent years, P&G then comfortably exceeded its short-term targets. Sales growth shot up to a 4% pace the following quarter to mark the fastest expansion rate in years, with volume and pricing trends finally pointing to healthy market share trends. Kimberly-Clark's comparable figure was just 1%. Combine that operating rebound with a broader flight toward high-quality, recession-resistant stocks as volatility spiked late in the year, and you have a formula for solid investor returns to close out 2018.

Looking ahead

A lot is riding on P&G's first earnings report of 2019, and not just because of investors' rising expectations for the stock. That announcement, set for Jan. 23, will show whether the prior quarter's sales boost was just a fluke or the start of a sustained period of stronger growth. It will also reveal whether management was too optimistic about the company's ability to raise prices on staples like diapers and paper towels without sacrificing market share in today's volatile selling environment.

If P&G can instead pair robust organic sales with rising average prices, then shareholders should see the business's first growth acceleration in years as it returns to market-share gains in fiscal 2019. These operating wins are far from guaranteed, but they do look achievable given the latest results. Faster sales growth, meanwhile, would combine with P&G's market-leading financial efficiency to support another significant dividend increase -- the company's 63rd consecutive annual boost -- in April.

Still, while financial metrics like direct cash returns and profitability are likely to impress investors in 2019, it's not likely that the stock will outpace the S&P 500 for a second consecutive year unless P&G can show continued positive market-share momentum.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.