It's been a rough year for investors as inflation, rising interest rates, and other macro headwinds rattled the markets. The S&P 500 has declined more than 20% this year, while the NASDAQ has tumbled by over 30%.

This bear market won't last forever, but it could drag on if rising rates fail to tame inflation and cause a global recession instead. The strong dollar will also continue to generate fierce headwinds for multinational companies.

Faced with these challenges, it's tempting to avoid stocks altogether until the macro headwinds dissipate. But could Procter & Gamble (PG -0.10%), which has weathered dozens of economic downturns over the past 184 years, actually be a great stock to buy before the bear market ends?

A family saves coins in a piggy bank.

Image source: Getty Images.

What does P&G do?

P&G is one of the largest consumer staples companies in the world with dozens of well-known brands like Tide, Pampers, Tampax, Charmin, Bounty, Gillette, Oral-B, Head & Shoulders, Pantene, and SK-II.

The bears once criticized P&G for accumulating too many brands over the years, then failing to prune its losers to let its winners shine. But that all changed over the past decade. Through a series of major divestments, including the sale of 41 beauty brands to Coty, P&G shrunk its portfolio from about 180 brands in 2014 to just 65 brands today.

That reduction caused its reported revenue growth to stall out, but its organic sales and core earnings per share (EPS), which exclude those divestments, have consistently risen over the past several years.

Period

FY 2022

FY 2021

FY 2020

FY 2019

FY 2018

Organic Sales Growth

7%

6%

6%

5%

1%

Core EPS Growth

3%

11%

13%

7%

8%

Data source: Procter & Gamble. Fiscal year (FY) ends in July of the calendar year. EPS = earnings per share.

P&G's growth is so stable because it's well-diversified across five main product segments: beauty, grooming, healthcare, fabric & home care, and baby, feminine, & family care. Its brands are widely recognized worldwide, reaching about five billion consumers in 180 countries. That scale gives it plenty of pricing power to weather economic downturns.

For fiscal 2023, P&G expects its organic sales to rise 3% to 5% and for its reported EPS to increase 0% to 4% -- even after factoring in a whopping 27 percentage-point impact from unfavorable currency exchange rates, elevated commodity costs, and higher freight costs. That stable forecast indicates it can weather the near-term inflationary headwinds.

But what about its margins?

P&G might be resistant to inflation, but higher costs and inflation still caused its gross and operating margins to shrink in fiscal 2022.

Period

FY 2022

FY 2021

FY 2020

FY 2019

FY 2018

Gross Margin

47.4%

51.2%

50.3%

48.6%

48.7%

Operating Margin

22.2%

23.6%

22.1%

8.1%

20.5%

Data source: Procter & Gamble

It's been offsetting some of that pressure by raising prices on the products that bring in more than 80% of its sales. That pressure could persist over the next few quarters, but analysts expect its operating margin to rise to 22.4% this year as it tightens its spending.

Is P&G still a shareholder-friendly company?

P&G is a Dividend King that has raised its payout annually for 66 straight years, and it currently pays a forward yield of 2.9%. Its projected EPS of $5.84 this year can easily cover its forward annual dividend of $3.65 per share.

P&G stock offers a lower yield than the shares of many of its consumer staples peers -- including Clorox, Kimberly Clark, and Unilever -- but it's also outperformed all three by a significant margin over the past 12 months.

The company also continues to gradually buy back its own shares. Over the past 10 years, it reduced its outstanding share count by about 13%. Last year, it bought back $10 billion in shares while paying out $8.8 billion in dividends.

But is P&G's stock reasonably valued?

P&G shares currently trade at 22 times forward earnings. That multiple seems a bit elevated for a company expecting to generate low-single-digit revenue and earnings growth this year and was likely inflated by the flight toward safer blue-chip stalwarts throughout the current bear market.

Therefore, P&G isn't really a screaming bargain yet -- and its valuation could cool off again if the macro situation improves and investors pivot toward pricier growth plays again. It's still a solid long-term investment, but investors should maintain realistic expectations for its near-term growth and realize it could lose its luster once a new bull market starts.