Investing legend Warren Buffett has said that his favorite holding period is forever, but his conglomerate, Berkshire Hathaway, sells stocks all the time. In fact, in the most recent quarter, it was an overall net seller.

Buffett looks for certain qualities in a company that he wants to own, and companies can change over time. For example, in the quote about his favorite holding period being forever, he qualified that statement.

The Oracle of Omaha said "forever" applied "when we own portions of outstanding businesses with outstanding managements." Although a defining feature of companies with outstanding management is that executive changes usually have limited impacts on the business, management teams do shift over time, and those changes could affect how Buffett and Co. view their investments.

However, there's one stock that Buffett has said he would never sell.

An outstanding business with outstanding management

And that stock is Coca-Cola (KO 0.26%). It was on Buffett's mind when he was quoted.

"In 1988 we made major purchases of ... Coca Cola," he said, as well as Freddie Mac. "We expect to hold these securities for a long time. In fact, when we own portions of outstanding businesses with outstanding managements, our favorite holding period is forever."

Between 1988 and 1994, Buffett spent a total of $1.3 billion on Coca-Cola shares, and the beverage maker is now the longest-held stock in Berkshire's portfolio.

He often cites Coca-Cola as an example of a great company with a strong brand. He has said that he's not a stock picker, but a business picker. He sees Coca-Cola as an excellent business, and that's naturally valuable because the value of an excellent business will increase over time.

Buffett counsels investors to look at investing that way -- as opposed to looking for stock movements -- since the fundamentals of the business will dictate the value of its stock over long periods of time.

Buffett also frequently mentions the great future he sees for America, and asserts that companies like Coca-Cola are the future of America. He wants to participate in that future by owning brands like Coke.

Is Coca-Cola still a great business?

Coca-Cola is a consumer goods company, and it's definitely feeling the impact of inflation. The company has successfully raised prices to meet increasing costs, and it's able to do that because it has such strong brands. Loyal fans want their favorite beverages, and in addition, Coca-Cola has done a good job of launching new products aimed at keeping sales flowing despite the harsh retail climate.

For example, it has introduced new packaging such as smaller bottles and cans so people can buy a Coke at a lower price point.

In the third quarter, Coca-Cola demonstrated impressive performance considering the overall environment. Net revenue increased 8% over last year, operating income grew 6%, and comparable earnings per share rose 7% to $0.74.

The company continues to innovate with new drinks, especially new flavors of popular drinks, and it boosts its brand with collaborations and what it calls "occasion-based marketing." This serves to strengthen relationships with customers and drive a presence in their lives.

Don't forget the dividend

One of the features Buffett loves in any stock is a dividend. Coca-Cola is a Dividend King that has raised its payouts for 61 consecutive years under all sorts of circumstances. It's not the highest-yielding dividend, but it's rock-solid. 

Coca-Cola stock is down about 12% this year due to a combination of negative investor sentiment about consumer goods stocks and a market trend back toward growth stocks. Coca-Cola stock gained 7% in 2022 when investors were flocking to safe stocks. 

At this writing, Coke's dividend yields around 3.3%, which is slightly above its average of about 3%. 

Buffett specifically singled out Coca-Cola as an example of how the dividend is so attractive for his business. He said it paid Berkshire Hathaway $704 million in 2022, and he expects the payout to keep growing.

That's the power of investing in strong brands with excellent management and great dividends, and it's no wonder Buffett said he'd never sell a share of Coca-Cola in his lifetime.