Warren Buffett has an investing track record anyone would love. As chairman of Berkshire Hathaway, he's delivered a compounded annual gain of nearly 20% over more than 50 years. That's double the increase of the S&P 500. The billionaire has always stood by the same investing principles: Choose solid companies that are undervalued and stick with them for the long term.

Though Buffett holds some high-growth shares in industries like technology, he's known to favor classic companies selling goods and services everyone needs -- from consumer products to banking services and medicines. Today, two of these classic players are on sale after falling in the double digits, and that offers you a great chance to get in on them -- and potentially win big over the long term just like Buffett. Let's take a look at these two Buffett favorites.

Coca-Cola

Buffett originally bought Coca-Cola (KO 0.49%) in the late 1980s and has held on ever since. There are plenty of reasons to like this beverage giant. One of them is the company's moat, or competitive advantage that helps the player keep its leadership position in a particular market. In Coca-Cola's case, brand strength and a solid distribution network have built up a significant barrier that rivals will have trouble dismantling.

We all know Coca-Cola for its beverage of the same name, but the company is also owner of other top brands that may fill your refrigerator: Minute Maid juices, Dasani water, and Sprite, just to name a few. People come back to these drinks they've known and loved for years. Coca-Cola has also adapted to changing tastes by offering products with lower sugar, for example, and innovated by launching limited edition drinks. The beverage powerhouse sells its products in more than 200 countries worldwide.

A few years ago, Coca-Cola refranchised its bottling operations, a wise move to result in lower costs and a leaner company over the long term. And Coca-Cola has delivered earnings growth and gains in return on invested capital in recent years, something sure to please Buffett.

KO Net Income (Annual) Chart

KO Net Income (Annual) data by YCharts

The billionaire investor clearly loves Coca-Cola for its dividend growth too. The world's biggest non-alcoholic beverage maker is a member of the elite list of Dividend Kings, or companies that have increased their dividends for at least 50 years. That shows dividend growth is important to them.

Today, Coca-Cola shares trade for only 20 times forward earnings estimates, an absolute steal considering the company's earnings strength and dividend growth.

Johnson & Johnson

You may know Johnson & Johnson (JNJ 0.47%) thanks to the products that populate your medicine cabinet, like Band-Aid bandages and Tylenol painkillers. But those products no longer belong to J&J. The company bid them goodbye with the recent spinoff of its consumer health unit into a new entity called Kenvue.

But don't worry. This was a great move for J&J, and that's because these highly popular products had actually been weighing on growth. Now, J&J can focus on its stronger-growth businesses of pharmaceuticals -- recently renamed "innovative medicine" -- and medtech. The Kenvue operation left J&J with $13.2 billion in proceeds, which could come in handy if J&J finds a program or company to acquire. J&J said earlier this year that its appetite for acquisitions is "voracious." Its last big acquisition, the purchase of heart pump specialist Abiomed, was a success, with Abiomed products now driving gains in the medtech business.

Meanwhile, in the most recent quarter, J&J reported sales growth of 6.8%, surpassing the growth of the past several quarters and beating analysts' estimates.

Quarter Johnson & Johnson sales growth
Q3 2023 6.8%
Q2 2023 6.3%
Q1 2023 5.6%
Q4 2022 -4.4%
Q3 2022 1.9%
   

Source: Johnson & Johnson earnings reports. 

About 10 of J&J's drugs, including top immunology drug Stelara, posted double-digit growth. Though Stelara is set to face biosimilar competition, that won't happen next year in the U.S., giving the product a chance to help J&J meet its target for $57 billion in pharmaceuticals revenue by 2025.

Buffett surely appreciates this earnings strength and likes J&J for dividends too. Like Coca-Cola, it makes the list of Dividend Kings. So, with J&J, you can collect passive income over time, no matter what the market is doing.

Today, J&J trades for only 15 times forward earnings estimates, which looks dirt cheap for such a solid player. That's why now is a great time to add this classic Buffett stock to any long-term portfolio.