The economic impacts from the coronavirus pandemic affected many restaurant and food service businesses. While restaurants felt the brunt of the financial challenges with closures or modified takeout-only options, packaged goods companies actually benefited from consumer demands during shelter-in-place restrictions.

Spice and flavors leader McCormick & Company (NYSE:MKC) is in a unique position to thrive in any consumer environment. With just over 60% of 2019 net sales coming from the consumer segment, and the balance from its flavor solutions group, the company was able to navigate the 2020 pandemic-related market crash with the help of its diverse customer base.

bags of different spices lined up in rows

Image source: Getty Images.

While every economic downturn is different, the most recent one looks to be a pretty good blueprint for how McCormick can emerge from the next one. In its second quarter, which ended May 31, the company reported a 10% sales increase in constant currency, and a 27% earnings jump compared to the previous year. The company said that its consumer segment grew significantly, which offset a "substantial sales decline in the flavor solutions segment." It's this diverse mix that should prove beneficial again during another downturn.

The increased interest in home cooking that sparked the jump in McCormick's consumer brands -- which include familiar spices as well as Frank's hot sauce, French's mustard, and Zatarain's Cajun rice -- may even become a longer-term growth trend. Additionally, the segment is diversified geographically, with brands in approximately 150 countries.

The flavor solutions portion of the business supplies food and beverage manufacturers, and should see a resurgence in demand when restaurants and foodservice operations return closer to pre-pandemic levels. The balance between the two segments gives investors a steady performer that should weather the next market crash well.