Warren Buffett's track record as an investor and CEO is unmatched. In his 54 years running Berkshire Hathaway (BRK.A -0.30%) (BRK.B -0.26%), thousands of people have become millionaires by buying shares and then sitting on their hands while he turned the former textile manufacturer into one of the most-profitable holding companies on Earth. As of this writing, Berkshire owns dozens of subsidiaries that earn tens of billions of dollars a year, and has a market capitalization of nearly $560 billion. 

Yet Buffett is best known for his skill as a great stock picker, and deservedly so. A massive portion of Berkshire's market value is derived from its roughly $215 billion stock portfolio. One of Berkshire's biggest holdings is Wells Fargo (WFC -1.11%): The 378 million shares it owned at the end of last quarter is worth $19.8 billion at recent prices. 

Warren Buffett smiling.

Image source: The Motley Fool.

So how much money has the Oracle of Omaha made for himself and Berkshire investors on Wells Fargo? It depends on what you're measuring; on a cost basis, Berkshire's Wells Fargo stake has roughly doubled in value, netting about $11 billion in unrealized gains. However, that doesn't tell the entire story, including how much value Wells delivers to Berkshire's coffers in the form of its generous dividend.

How much Buffett paid, and what it's worth now

While we don't know from day to day how many shares of Wells Fargo Berkshire Hathaway owns, we do get an update each quarter, when it files its Form 13F with the SEC, listing its stock holdings. As of the end of September, Berkshire owned 378,369,018 shares of Wells. At recent prices of around $52 per share, that stake is worth $19.8 billion. 

Getting to Berkshire's cost basis is a little bit trickier. The company doesn't include the cost basis of its stock portfolio holdings in its quarterly filings, and that data is not broken out in the 13F either. However, in Buffett's annual letter to shareholders -- a highly recommended read every year -- does include the cost basis for Wells, along with that of Berkshire's other biggest holdings.

Last year's letter -- the new one will arrive in the next couple of months -- showed a cost basis of $10.639 billion on Berkshire's stake in Wells Fargo. However, that value was on 449,349,102 Wells Fargo shares. To keep its stake in Wells below 10% (a regulatory requirement for investing in banks), Berkshire sold off nearly 71 million Wells shares in 2019, to stay ahead of Wells' own aggressive share-repurchase policy. 

If we remove those 71 million shares -- at a cost basis of about $23.68 per share, according to Buffett's letter -- from the equation, then we arrive at a rough cost of $8.96 billion for Berkshire's current stake, which is worth $19.8 billion. So that's about $10.8 billion in unrealized gains on the investment as of the end of the third quarter. 

Here's how much Wells Fargo pays Berkshire in dividends

Considering all the turmoil Wells Fargo has gone through in recent years, particularly the "fake accounts" scandal that still has the bank under SEC sanctions that limit its growth, many investors have been surprised Buffett hasn't sold off Berkshire's stake in it and moved on. 

However, that knee-jerk reaction ignores the fact that Wells continues to generate substantial profits and strong returns, as well as what may be the biggest reason Berkshire should hold on to the bank's stock long term: its dividend

In 2019, Wells Fargo raised its quarterly payout to $0.51 per share. That works out to $2.04 per year at the current rate. Based on the 378.4 million shares it held at last count, Wells Fargo will send Berkshire $771.9 million in dividends in 2020. 

Taking it a step further, Wells' track record of dividend growth has rewarded Berkshire -- and every other long-term Wells Fargo shareholder -- quite well for just holding. Since the beginning of 2014, Wells has increased its payout by 70%. For Berkshire, that means it has seen the dividends it earns on those 378.4 million shares grow from $454 million in 2013 to more than three-quarters of a billion dollars this year. 

To put it another way, that means Berkshire earns about 8.6% in yield on the $9 billion it paid for its stake in Wells, just on from the dividend. That's an incredibly high rate of return all by itself. 

An excellent case study in wealth creation

Buffett has long sung the praises of the "buy high-quality companies, hold them for a very long time" strategy, and Wells Fargo proves that out quite well. While plenty of investors may look at a stock in their portfolio that's doubled in value and sell to "take money off the table," Buffett continually demonstrates that the best businesses will continue helping investors build wealth if they simply hold on.

Sure, Buffett could sell and realize $11 billion in profits; but he'd lose almost $800 million in yearly cash flows by doing that, not to mention creating a $2.3 billion federal tax bill on those gains. 

So before you sell your next stock just because it's made major share price gains, consider the long-term implications, and whether you'd be better off just sitting on your hands and letting that great business continue being great -- and growing your wealth. Buffett is undoubtedly a master, but some of his best "secrets" are simple actions any investor can replicate, like not selling your best investments just because they've gone up in value.