If you're tired of prices at the grocery store going higher and higher, then recent comments from Alan Jope, CEO of consumer-goods conglomerate Unilever (UL 0.34%), may be unsettling. Speaking to a CNBC reporter at the World Economic Forum last week, Jope reiterated something he said in October; back then he said we're "probably not at peak prices," and that's still the case today.

Unilever is a single data point. But similar data from fellow consumer-goods company Procter & Gamble (PG 0.86%) establish an emerging trend for 2023: Inflation may be coming to an end, but the consequences of inflation are still working their way through the system. Here's what it means for investors.

Prices might still go up from here

Unilever's brands include well-known consumer staples like Dove soap and Hellmann's mayonnaise. Its products are sold around the world, and that gives the company perspective that not every company has. With operations in countries like Argentina and Turkey, Unilever has seen periods of high inflation before and is quick to act.

In the third quarter of 2022, Unilever's volume of products sold was down 1.6% year over year. But revenue was up 10.6% -- because the company raised prices by 12.5%.

We all know why Unilever raised its prices: Inflation caused costs to increase. Since it wants to earn profits, it had to increase its prices.

On Jan. 19, Procter & Gamble -- known for brands like Tide laundry detergent and Bounty paper towels -- reported similar trends for the second quarter of its fiscal 2023. In Q2, Procter & Gamble's volume was down 6%, but net sales were only down 1% because it raised prices to preserve profits.

Yet even though companies have increased prices, Unilever's CEO says we still aren't at peak prices for consumers. And it's easy to see why. In Q2, Procter & Gamble's gross profit margin fell from the prior-year period, even with its price increases. And as the chart below shows, it's still substantially below where it was:

PG Gross Profit Margin (Quarterly) Chart

PG Gross Profit Margin (Quarterly) data by YCharts.

Only after inflation has fully peaked for consumer-goods conglomerates -- which hopefully it has -- can they finally pass on all the extra costs to consumers. Therefore, this consequence of commodity inflation is still working its way through the system.

What it means for investors

First, many investors look at the valuation of the broader stock market, specifically the S&P 500, and conclude it's cheap. According to Yardeni Research, the S&P 500 trades at about 17 times its forward earnings estimates, down sharply from its valuation in 2020 and 2021.

YCharts shows a higher forward valuation for the S&P 500 but similarly shows that the valuation has come down.

S&P 500 P/E Ratio Forward Estimate Chart

S&P 500 P/E Ratio Forward Estimate data by YCharts.

However, the market might not be as cheap as it looks, because earnings estimates may come down in the coming months. For example, Procter & Gamble just raised its sales guidance but kept its earnings guidance the same. Reading between the lines, the company intends to raise prices more because inflated costs are still a problem it's dealing with.

Many companies are likely in the same boat as Unilever and Procter & Gamble -- working to regain lost profit margins. In 2023, it's possible that profits across the S&P 500 come in below expectations and cause the market to fall, adjusting to this lower profit reality.

But this brings me to my second point, which is actually the more actionable takeaway from this article: Inflation can hurt stocks in the short term, but businesses eventually adjust.

I say this tongue-in-cheek because nobody can predict the future with complete accuracy: As I look into my crystal ball for 2023, I expect the stock market to react negatively at some point as profits continue taking hits from inflation.

That said, I also expect Unilever, Procter & Gamble, and others to eventually get past this exogenous issue. Prices will increase and margins will recover, and the result will be higher earnings, which will likely lead to higher stock prices. Given enough time, stocks are inflation-proof -- just look at inflation over the past 50 years and compare it to the performance of the S&P 500.

Equipped with this knowledge, I fully expect to find great stocks to buy for the long term in 2023, which is why I'm not changing strategies. Inflation is clearly a problem in the short term. But as the market frets over the near term, buy-and-hold investors will likely be able to scoop up shares of quality companies to generate market-beating gains.

Therefore, it's as important as ever to remain vigilant, looking for opportunities.