Procter & Gamble (PG  ) reported Q4 earnings that beat across most metrics, and the company issued guidance above expectations. Shares were slightly higher in the following session but gave back the bulk of post-earnings gains.

Overall, P&G's stock has been a rare place of safety for investors amid the market volatility. While the market is off by more than 10% from its highs, P&G is off by less than 5%. The major reason is that P&G's earnings are much less affected by changes in the economy or monetary policy than other stocks. It's considered almost bond-like due to its safe and above-average dividend yield of 2.2% and track record of dividend hikes. It also provides protection against inflation due to its pricing power.

Inside the Numbers

Nothing about P&G's fiscal first-quarter earnings report would invalidate its place as a way to shield investors from volatility. The company topped earnings expectations at $1.66 per share vs $1.65 per share and a 2% gain from last year. It also marks the company's fourth straight beat.

Revenue was $21 billion, a 6% increase from last year, and above analysts' expectations of $20.5 billion. It saw growth across every segment, another positive sign. The company also raised its guidance for sales growth in 2022. Currently, analysts are looking for the company to earn $1.65 in Q2 on $20.3 billion in revenue.

The company did see some negative impact due to rising costs with gross margins compressing by 400 basis points largely due to rising freight and material costs. The company was able to offset some of this by reducing costs and selling more higher-margin items. Overall, inflation is expected to impact earnings by $2 billion this year.

This is also another sign that inflation is starting to adversely impact earnings as P&G is one of the better-positioned companies to benefit from inflation.

However, the company remains on track despite this roadbump with its recent upgrade in outlook to sales, earnings, and cash flow. Overall, it's expected to return $18 billion in cash to shareholders via buybacks and dividends.