As the U.S. economy deals with both a recession and the COVID-19 pandemic, it's a good time to look at your portfolio and examine which companies will do well under unfavorable economic conditions. Even some companies that have proven recession-resistant in the past are adapting to atypical conditions now.

For instance, the shutdown measures that governments around the world have taken to minimize the spread of the novel coronavirus have taken a toll on Coca-Cola (KO -0.14%). Certain U.S. states and the U.K. have revisited or rolled back reopening plans, putting a crimp in how quickly the beverage maker's results will recover.

At some point, governments will likely ease restrictions, but it's not clear how fast the global economy will recover. If economic activity remains depressed and high unemployment does not come down quickly, how will Coca-Cola fare?

A hand holding a cup that is filling up with soda from a machine.

Image source: Getty Images.

Less dining out

Coca-Cola is the world's largest non-alcoholic beverage company, selling water, sports drinks, and, of course, soda. In fact, it sells four out of the five top-selling soft drink brands in the world -- Coca-Cola, Diet Coke, Fanta, and Sprite. Out of all beverages served around the world, Coke's brands account for 3%. While consumer tastes are shifting away from sugar-based soft drinks, the company has looked to protect its market share by offering products beyond soda, such as water, juice, and plant-based beverages.

For many people, enjoying a Coke means picking it up at a store and bringing it home. But about 50% of the company's revenue comes from sales away from home: think of bars, restaurants, and stadiums. Certainly, Coca-Cola has felt the impact of social distancing and closures. In the second quarter, revenue under U.S. generally accepted accounting principles (GAAP) declined by 28% from the year before to $7.2 billion. Some of this revenue will come back as governments relax restrictions and allow restaurants and bars to fully reopen. However, during a downturn with high unemployment, people will undoubtedly cut back on this discretionary spending.

Long-term investment

Coca-Cola's stock is down more than 13% this year as of Wednesday morning, and the economy is far from out of the woods. Coca-Cola's sales and profits will likely feel some pressure as the recession continues -- second-quarter revenue fell 2.7%. Still, that compares favorably to sales at rival PepsiCo. The snack and beverage company saw its adjusted second-quarter revenue (12 weeks that ended on June 13) stay essentially flat while its earnings per share fell 11%. But Pepsi's beverages segment fell 6.6% from the same period the year before.

Plus, Coca-Cola is a solid cash-flow generator. Even in a tough first half, its operating cash flow was $2.8 billion. Granted, this is down from last year's $4.5 billion, but not too bad considering the circumstances. After spending $536 million on capital expenditures, this still left plenty of free cash flow to pay a dividend that currently yields 3.4%.  Coca-Cola is a Dividend Aristocrat, a group of S&P 500 companies that have raised their dividends annually for at least 25 consecutive years. Coca-Cola has done so for 58 straight years.

That's something you can do when you have a history of riding out storms. Let's look back to how Coke did during the Great Recession. While its 2008 revenue rose to $31.9 billion from $28.9 billion, Coca-Cola's diluted earnings per share dipped to $2.49 compared to $2.57. The following year, revenue fell to $31 billion, but its earnings rose to $2.93. The stock price at the start of 2008 was about $30, and it fell to below $20 during the first half of 2009 before recovering to $28.50 at the end of the year.

Beyond the recession

Looking at the long-term picture, Coca-Cola's prospects appear bright.  The company's results are not immune to the whims of the economic cycle, and the stock price has reacted to the current climate. But you can reap the benefits if you have patience over a long horizon. Over the last five years, earnings have increased at a compounded annual rate of about 4%. Plus, with the stock at this level, you receive the 3.4% dividend yield. That'll surely put a smile on your face.