Investors should enjoy especially happy holidays this year. Barring a stunning late December collapse, the stock market will deliver hefty gains in 2023.

The big question now is: Can the momentum continue into the new year? For those who look to the past to try to discern what might happen in the future, there could be an intriguing answer to that question. The S&P 500 is poised to do something it's only done three times ever. Here's what history says it could mean for stocks in 2024.

People looking at charts on monitors and cheering.

Image source: Getty Images.

A rare occurrence for the S&P 500

Standard Statistics Company, which later merged with Poor's Publishing to form Standard & Poor's (now S&P Global (SPGI 0.07%)), first created a stock market index of U.S. companies back in the 1920s. However, the S&P 500 in its current form with 500 companies dates back to 1957.

During its 66-year history, the S&P 500 has delivered positive annual gains roughly 70% of the time. Down years aren't unusual, but positive years are much more common. What is rare, though, is for the S&P 500 to experience a large decline in one year followed by a huge gain in the following year.

From 1957 through 2022, the S&P 500 fell by 15% or more five times. The index rebounded by 15% or more in the following year only three times. The most recent example was in 2008 and 2009 with the stock market crash and subsequent comeback. Now, this rare occurrence appears to be about to happen again. The S&P plunged 19% in 2022 but is set to finish 2023 up more than 20%.

Even if we look at the indexes that were predecessors to the modern S&P 500, such steep declines followed by significant bounces are infrequent. There have been only five previous times since the 1920s when the S&P 500 and its previous versions fell by 15% or more, then rose by 15% or more in the next year.

Historical precedents

So has the S&P 500 been like a yo-yo in the past -- falling, rising, then falling again? Nope. Let's look at how the index has performed in the year following a big rebound.

In 2008, the S&P 500 plunged over 38% with markets roiled by the financial crisis. The next year, it bounced back by more than 23%. That momentum continued, albeit at a moderated pace, in 2010 with the S&P rising nearly 13%.

^SPX Chart

^SPX data by YCharts

It was a similar story early in the 21st century. The S&P 500 fell 23% in 2002 in the continued aftermath of the dot-com bubble bursting. In 2003, the index roared back with a 26% jump. The S&P rose more in 2004, but with a smaller gain of close to 9%.

^SPX Chart

^SPX data by YCharts

The same pattern emerged during the 1970s. In 1974, the S&P 500 plummeted nearly 30%. It rebounded by almost 32% in the next year. The index then rose another 19% in 1976 -- a strong but smaller gain.

If history is a guide, we could see the same thing happen in 2024. The S&P 500 could continue its positive momentum in the new year but deliver a performance that isn't as impressive as that of 2023.

Will stocks really jump again in 2024?

Unfortunately, there's no guarantee that history will repeat itself. From a statistical standpoint, the trends from the past are virtually meaningless because of the low sample size.

Granted, some Wall Street analysts think that the S&P 500 will rise, but at a more modest rate, next year. For example, Bank of America (BAC -0.21%) analysts set a target price for the index of 5,000, reflecting an increase of nearly 6% from its current level. Goldman Sachs (GS 1.79%) expects the S&P 500 to hit 5,100 next year, a gain of nearly 8%. No one knows for sure what the stock market will do over the next year, though.

The good news is that long-term investors don't have to be concerned about it. Over a long period, the S&P 500 almost always goes up. As Warren Buffett once stated: "In aggregate, American business has done wonderfully over time and will continue to do so (though, most assuredly, in unpredictable fits and starts)." Whatever happens in 2024, the long-term outlook for the stock market should be bright.