Image source: P&G.

Many things went wrong for consumer goods giant Procter & Gamble (NYSE:PG) this past year. Fiscal 2016 marked its second straight year of decelerating sales growth as it lost market share in key product categories. P&G also underperformed its own profit target, with core earnings declining 2%.

Yet the company blew past management's long-run targets on cutting costs. And executives are hoping to keep that momentum going by squeezing even more cash out of its expense structure over the next few years.

Success at slicing costs

Five years ago, P&G outlined a plan to knock $1.2 billion out of its annual cost of goods sold. With initiatives like production, packaging, and infrastructure tweaks, the company hit that target for fiscal 2012 before blowing right past it over the next four fiscal years. Overall cost of goods savings for the five-year period amounted to $7.2 billion, or $1.4 billion per year.

P&G's cost-cutting. Image source: P&G investor presentation.

P&G supplemented those cuts with significant savings elsewhere in the business. Manufacturing expenses plunged, as did overhead costs. The company also gained from reducing complexity in its supply chain and from cutting down the network of marketers and advertising firms that it employs. As a result, the business is becoming more profitable while growing easier to manage.

Most of those profit gains were swamped last year by the combination of several negative trends, including a strengthening U.S. dollar and lost growth from P&G's brand divestment initiative. Now that its portfolio is down to the size it wants, though, more of the savings can flow down to the bottom line. Core earnings improved by 5% to start off fiscal 2017, reversing last year's slight decline.

The savings plan

With its five-year savings plan complete, management rolled out an even more aggressive plan for the next five years. From now through fiscal 2012, CEO David Taylor and his team aim to slice as much as $2 billion out of annual costs for a total savings of $10 billion.

PG Cost of Goods Sold (TTM) Chart

PG Cost of Goods Sold (TTM) data by YCharts.

Executives plan to plow most of the resulting windfall into initiatives aimed at boosting sales growth. These include the critical research and development (R&D) category, which has held steady at $2 billion per year. Johnson & Johnson (NYSE:JNJ), in contrast, has raised its R&D commitment to $9 billion, up 10% over the last three years. P&G hasn't launched a new $1 billion brand in over a decade, and hefty investments in this area could help turn the tide.

Another big piece of the savings will go toward advertising. Increased spending here was a key driver behind last quarter's surprisingly strong sales volume gains. P&G expects to increase advertising support for key brands like Tide detergent and Gillette razor blades while also directing resources toward its very profitable trial programs. The company got its Pampers diapers into the hands of 70% of new moms thanks to its partnerships with hospitals around the country. Its latest Gillette razor blade, meanwhile, made it to around 80% of men on their 18th birthday.

Investor returns

After reinvesting in the business, the cost savings should still leave room for increased cash returns to shareholders. In fact, P&G aims to deliver $22 billion directly to investors this year through dividends and stock repurchases on the way to meeting its massive $70 billion return goal by 2019.

In the current weak sales environment (P&G only expects 2% organic sales growth this year), the company likely couldn't hit that aggressive capital return target while still investing in the business. But significant efficiency gains are giving the company plenty of flexibility in how it chooses to meet its financial targets.

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.