Just two months ago, the stock market was in free fall due to fear about the impact of the COVID-19 pandemic. The S&P 500 index plunged 35% between mid-February and late March. That represented the deepest bear market since the Great Recession.

The massive sell-off in stocks led many investors to wonder whether famed investor Warren Buffett would capitalize on this opportunity to make some big stock purchases -- or even acquire entire companies. After all, Berkshire Hathaway's (BRK.A -0.28%) (BRK.B -0.68%) insurance subsidiaries ended 2019 with a whopping $125 billion of cash and U.S. Treasuries available to make investments.

Instead, at Berkshire's annual meeting earlier this month, Warren Buffett revealed that the conglomerate had been a net seller of stocks year to date. Berkshire Hathaway only made minor stock purchases -- at least by Berkshire standards -- and they were more than offset by Buffett's decision to bail out of airline stocks.

Yet while many were shocked by this inactivity, the events of the past few months were hardly unprecedented. In fact, the past year looks like a repeat of 1987 for Warren Buffett and Berkshire Hathaway.

Warren Buffett in a crowd of people

Image source: The Motley Fool.

Looking for elephants

As Berkshire Hathaway's cash pile has grown in recent years, Warren Buffett has talked repeatedly about looking for "elephant-sized" acquisitions. However, he has been waiting for attractive companies to become available at reasonable prices. As usual, Buffett has been careful not to get greedy by buying "cheap" stocks with weak business fundamentals.

Buffett reiterated this point a little over a year ago in his annual shareholder letter:

In the years ahead, we hope to move much of our excess liquidity into businesses that Berkshire will permanently own. The immediate prospects for that, however, are not good: Prices are sky-high for businesses possessing decent long-term prospects.

That disappointing reality means that 2019 will likely see us again expanding our holdings of marketable equities. We continue, nevertheless, to hope for an elephant-sized acquisition.

Indeed, Berkshire Hathaway's cash pile increased significantly last year. Aside from the lack of attractive acquisition candidates, Buffett also struggled to find reasonably priced stocks to buy. And even though the stock market's plunge earlier this year was deep and traumatizing, it didn't change this dynamic.

Another 1987

In more than half a century leading Berkshire Hathaway, Warren Buffett has experienced all sorts of market conditions. But what's transpired recently was hardly unique.

In his 1986 shareholder letter (published in early 1987), Buffett wrote, "[W]e currently find no equities that come close to meeting our tests." He observed that "euphoria" on Wall Street had driven stock prices up to levels that didn't correspond to the companies' underlying business prospects. As a result, during 1986, Buffett put most of Berkshire Hathaway's excess cash into tax-exempt bonds, seeing them as the least bad alternative.

Just months later, Wall Street's euphoria finally evaporated in dramatic fashion. Stocks began to slide in the first half of October 1987. And on Black Monday -- Oct. 19, 1987 -- the stock market plunged more than 20% in a single day. Despite that record-setting drop, Buffett didn't buy much stock during 1987. As he described in his annual shareholder letter:

At Berkshire, we have found little to do in stocks during the past few years. During the break in October, a few stocks fell to prices that interested us, but we were unable to make meaningful purchases before they rebounded. At yearend 1987 we had no major common stock investments (that is, over $50 million) other than those we consider permanent or arbitrage holdings.

At first glance, the lack of action might seem surprising. But as Buffett noted, the stock market actually rose 2% in 1987. There was a massive rally, followed by a deep plunge, followed by a modest rebound. Given that the Oracle of Omaha didn't see any compelling opportunities in 1986, it's not surprising that he couldn't find much worth buying in 1987.

^SPX Chart

S&P 500 1987 Performance, data by YCharts.

The stock market's action over the past year has been eerily similar to what occurred in 1987. As Buffett put it three decades ago, there has been "much excitement but little net movement" -- the market experienced a big rally, a massive drop, and then a rapid recovery. The net result is that the S&P 500 has risen a little more than 1% in the past 12 months.

^SPX Chart

S&P 500 Performance, data by YCharts.

Just as in 1987, stocks were only cheap for an instant during this year's bear market. Even then, they weren't that cheap. In a clear parallel to 1987, the market didn't go low enough for long enough to enable Buffett to make big stock purchases, let alone acquire a large, high-quality business at an attractive price. By late April, stock prices were back to the year-ago levels at which Buffett saw few (if any) compelling opportunities in the stock market.

No reason for Berkshire investors to be demoralized

Naturally, many Berkshire Hathaway investors were disappointed that Warren Buffett didn't find anything to buy during this year's market crash. After all, it seemed to many that this was the moment they had been waiting for, when Buffett would finally move Berkshire's massive pile of cash and low-yielding Treasuries into companies that could deliver fantastic long-term returns.

Shareholders shouldn't be too disappointed, though. Buffett's belief that stocks were overvalued at the end of 1987 turned out to be wrong. Over the following 20 years, the market posted a total return of nearly 500%, turning $10,000 invested in the market at the beginning of 1988 into nearly $60,000 by the end of 2007. That works out to a solid 9.3% compound annual growth rate (CAGR). Yet the same $10,000 invested in Berkshire Hathaway stock at the beginning of 1988 would have grown to nearly $200,000 over that period: a 15.8% CAGR!

BRK.A Chart

Berkshire Hathaway vs. S&P 500: 1988-2007, data by YCharts.

In short, Buffett's failure to act quickly and decisively immediately after the market plunged in 1987 didn't hurt shareholders at all. It may have even helped. Just a year later, the Oracle of Omaha found two of the most successful investments of his career, buying shares of Coca-Cola and Freddie Mac. He continued to find attractive opportunities to deploy Berkshire Hathaway's capital over the next two decades.

High-quality stocks may not be cheap enough to make Warren Buffett pull out his elephant gun. But between its existing collection of premier businesses and a massive war chest that can be deployed whenever compelling investment opportunities do turn up, Berkshire Hathaway stock is still an excellent choice for long-term investors.