McCormick (MKC 0.44%), a leading purveyor of spices, condiments, and other flavorings, reported earnings this week, and the results are interesting not only for McCormick shareholders, but also for the investing community in general as they might provide some insight into what's to come as earnings season picks up.

In its second quarter of 2022, McCormick felt the impact of the macroeconomic headwinds we've been seeing and hearing about for the past few months. As one would expect, this led to weak results that are atypical of this consistent albeit slow-growing company. So how should investors digest a quarter like this? Taking a long-term mindset, I see it as a bump in the road that's still leading to positive shareholder returns over time.

So what happened?

In short, almost every financial and business metric was weaker than usual. Revenue was down 1% year over year, which is the first time that's happened since the beginning of the pandemic. The gross margin fell to 34% from 39.5% in the year-ago quarter, and earnings per share (EPS) were $0.44, down 35%. McCormick's consumer segment was hit particularly hard, with revenue falling 8% and operating income down 29%.

Some of this was expected by the company as these challenges began showing up in the first quarter when inflation began to eat into margins. Heading into the second quarter, management expected some margin compression due to inflation and the startup costs of a new factory. However, the escalation of inflation and supply chain costs as well as COVID-related impacts in China were unanticipated and further contributed to the challenges.

One bright spot for the quarter was the flavor solutions segment (sales to food-service and restaurant customers), which saw revenue increase 10% on top of 35% in the year-ago quarter. This quarter's growth was driven by higher sales to food-service customers as well as packaged-food and beverage companies. Second-quarter sales in this segment have grown at an 8% compound annual rate over the past three years. 

What comes next?

McCormick is very transparent about its plans to combat these headwinds and is confident that it will emerge on the other side in good shape. Having already raised prices a bit to combat its rising costs, the company plans to do so again.

It has also been working on a multi-year plan that it believes will help defray rising costs as well. Management believes these strategies will outpace cost pressures by the third quarter of this year and fully offset them over time.

COVID-related shutdowns in China during the second quarter also had an outsized impact on results as that country is McCormick's second-largest in sales. Beyond the obvious disruptions to all parts of the business due to the lockdowns, the environment in China has also prevented it from raising prices to offset the impact.

The company doesn't believe it will be able to recover these lost sales and profits this year, but it does see these challenges as temporary and believes in China as a market in the long term.

The impact on investors

Despite all the challenges, McCormick is still guiding for full-year sales growth of 3% to 5% although it has lowered its guidance for adjusted operating income and adjusted EPS. Even with the lowered guidance, the company expects adjusted EPS to be just about breakeven for the year.

McCormick is an example of how the long-term mindset is important when investing. The last time the company had a quarter with similar results was the first quarter of 2020, when the pandemic first affected the business. In the ensuing quarters, results have been strong, and McCormick has a long track record of success. Over the past 10 years, its shares have enjoyed a total return of 95% compared to 73% for the S&P 500.

McCormick was still cash flow positive in the second quarter and pays a dividend that yields 1.7%. I believe the stock can help anchor an investment portfolio. The next few quarters might be bumpy, but the company will likely get through it and return to the market-beating returns investors have seen in the past.