Warren Buffett's Berkshire Hathaway (NYSE: BRK-B) holds a massive portfolio of stocks, but Coca-Cola (NYSE: KO) and IBM (NYSE: IBM) are two of its largest holdings. Buffett started investing in Coca-Cola in 1988, after the crash of 1987 halted the company's multi-year rally. Despite his well-known distaste for tech stocks, Buffett also started buying shares of Big Blue in 2011 after former CEO Sam Palmisano claimed that he could double its annual EPS to $20 per share between 2010 and 2015. Image source: Pixabay. Coca-Cola turned out to be a great buy. Adjusted for dividends and splits, Buffett paid an average price of $2.45 per share, and the stock now trades at $42. IBM didn't fare as well. Palmisano tried to reach the $20 target by selling businesses, cutting costs, and buying back stock, but sales growth stalled out. His successor, Ginni Rometty, eventually abandoned that target to invest in higher-growth cloud businesses. Due to those growing pains, IBM remains down 9% from Buffett's cost basis of $170 per share. But investors should know that past performance never guarantees future returns. Therefore, let's examine Coca-Cola and IBM's sales growth, profitability, and valuations to see if either Buffett play is a worthy investment at current prices. Different industries, similar challenges Coca-Cola and IBM are in different industries, but they face similar headwinds. Both companies are trying to pivot away from aging core businesses that have fallen out of favor. Coca-Cola has tried to counter declining sales of sugary sodas worldwide by diversifying into bottled water, sports drinks, teas, juices, and even dairy products. IBM faces sluggish demand for its core IT services, hardware, and software as customers transition from on-premise solutions to cloud-based ones. To catch up, IBM has been inorganically growing its "strategic imperatives" of cloud, analytics, mobility, social, and security platforms. Image source: Getty Images. Both Coca-Cola and IBM face tough currency headwinds, which could become even stronger if higher interest rates cause the dollar to rise. Both companies are also besieged by nimbler or better-diversified rivals: Coca-Cola's main rival, PepsiCo, uses its Frito-Lay and Quaker Foods divisions to soften the blow of slower soda sales, while IBM still can't close the gap with Amazon and Microsoft's big leads in the cloud computing market. How fast are Coca-Cola and IBM growing? Coca-Cola's revenue fell 4% in fiscal 2015, but its organic revenue (which excludes currency impacts, divestments, acquisitions, and other charges) rose 4%. Its carbonated beverages posted 1% global volume growth, while still beverage volume rose 8% thanks to growth in bottled water, tea, coffee, and sports drinks. But looking ahead, analysts expect Coca-Cola to post a 6% sales decline this year followed by a 14.5% decline next year, mainly due to weak organic growth exacerbated by tougher currency headwinds. IBM's revenue fell 9% in 2015 and dipped 2% on a constant currency basis. The company's core IT services, hardware, and software revenues are all still shrinking too quickly for its strategic imperatives to pick up the slack. That's why Big Blue's sales have declined annually for 17 consecutive quarters to date, and why analysts expect the company's sales to fall 2.6% this year and 0.4% next year. However, IBM's projected declines don't look as severe as Coca-Cola's, and indicate that its strategic imperatives could finally offset more of the losses at its legacy businesses next year. Profitability, valuations, and dividends Coca-Cola's earnings are expected to decline 4.5% this year but recover 5.2% next year on cost-cutting refranchising plans in China coupled with buybacks. IBM's earnings, which are also boosted by buybacks, are expected to fall 9.5% this year but rebound 4.4% next year as its higher-margin strategic imperatives businesses account for more of its top and bottom lines. Coca-Cola currently trades at 24 times earnings, which merely matches the industry average for soft drink companies. IBM has a P/E of 13, which is much lower than the average P/E of 21 for the IT services industry. Looking ahead, analysts expect Coca-Cola to grow its earnings just 3% annually over the next five years, which gives it a very high 5-year PEG ratio of 7.6. IBM's annual earnings are also expected to rise about 3% during the same period, but its lower P/E translates to a lower PEG ratio of 4.2 -- indicating that it's cheaper relative to its earnings growth potential. Coca-Cola pays a forward yield of 3.3%, while IBM pays a higher yield of 3.6%. Neither company will likely stop raising its dividend anytime soon -- Coca-Cola is a dividend aristocrat which has hiked its payout annually for over five decades, while IBM has done the same for 16 years. The winner: IBM Coca-Cola had a great run over the past few decades, but IBM's better growth estimates, lower valuations, and higher dividend make it a better long-term play at current prices. Perhaps that's why Buffett has repeatedly refused to sell the stock, and even proclaimed in interviews that he "loves it" when "the stock goes down" and allows him to buy more shares. A secret billion-dollar stock opportunity The world's biggest tech company forgot to show you something, but a few Wall Street analysts and the Fool didn't miss a beat: There's a small company that's powering their brand-new gadgets and the coming revolution in technology. And we think its stock price has nearly unlimited room to run for early in-the-know investors! To be one of them, just click here.Leo Sun owns shares of Amazon.com. The Motley Fool owns shares of and recommends Amazon.com, Berkshire Hathaway (B shares), and PepsiCo. The Motley Fool owns shares of Microsoft. The Motley Fool recommends Coca-Cola. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.