The large U.S. bank Wells Fargo (WFC -0.26%) has had a chaotic last couple of years. Since 2016, the bank has been dealing with the fallout of the phony-accounts scandal, in which employees at the bank opened millions of credit card and bank accounts without the consent of its customers.

Like all other banks, Wells Fargo has also had to deal with the start of the pandemic, which put most banks through the wringer.

But Wells Fargo had been a very solid-performing bank leading up to the phony-accounts scandal and has made progress recently as well. Let's take a look at how much money you would have today if you had invested in Wells Fargo on the eve of the Great Recession in 2007.

Post-Great Recession

The Great Recession took hold of the country and brought many banks, which were at the center of the crisis, to their knees. Most banks struggled in one way or another because of the contagion, but broadly speaking, Wells Fargo performed better than most of its peers during the years between 2007 and 2011.

WFC Return on Equity Chart.

WFC Return on Equity data by YCharts.

During this stressed period, the bank regularly had the highest internal return on equity of all of its peers and significantly outperformed Bank of America and Citigroup. The bank did a much better job of avoiding subprime mortgage exposure that would eventually lead to the failure of more than 500 banks between 2007 and 2015.

In 2008, Wells Fargo agreed to purchase the beleaguered Wachovia, which regulators had told to find a buyer. The bank had to charge off close to 15% of Wachovia's loan book. But the move also doubled the size of Wells Fargo and made it the country's fourth-largest bank.

The phony-accounts scandal

Things were going pretty well for Wells Fargo following the Great Recession, with its stock price rising from the mid $30s into the high $50s in 2015.

Then the phony-accounts scandal hit in 2016 and sent shockwaves throughout the entire industry, becoming the center of all of the major news publications and putting Wells Fargo at the mercy of banking regulators. The regulators came down hard and charged Wells Fargo billions in fines. Wells Fargo also faced numerous lawsuits and continues to pay damages to this day.

Additionally, the Federal Reserve took the unprecedented move of placing an asset cap on Wells Fargo in 2018, essentially limiting balance sheet growth until the bank could clean up its act and fix its internal controls and risk management protocols. Now, almost five years later, the asset cap is still in place and has cost the bank billions in profits by the very nature of not allowing Wells Fargo to grow its interest-earning assets.

While all of this was happening, there was tons of turnover in Wells Fargo's C-suite and board of directors, most of which is now made up of new faces. In 2019, Wells Fargo hired Wall Street veteran Charlie Scharf to oversee the bank's transformation. Rumors had it that longtime shareholder Berkshire Hathaway, the large conglomerate owned by legendary investor Warren Buffett, was not pleased with the move.

In 2020, the pandemic hit, and the Federal Reserve swiftly lowered interest rates to practically zero, hitting Wells Fargo particularly hard. The bank was one of the few that had to cut its dividend in 2020, largely due to restrictions on capital distributions put into place by the Fed. The stock hit less than $22 in late 2020, and Berkshire Hathaway has spent the past few years exiting its longtime position in the bank. 

However, since the pandemic started, Scharf seems to have done a good job of turning the bank around. He's hired a new management team, updated regulatory protocols, made incremental progress on the asset cap, raised the dividend, sold off several units of the bank that were not critical to its core U.S. franchise, and cut billions of expenses in a broader ongoing efficiency initiative. Rising rates have made the bank more profitable, and the stock has rebounded to around $47 per share.

How much would your $5,000 investment be worth now?

If you had invested $5,000 at the start of 2007, you could have purchased the stock for around $36 per share. Since this time, shares have ranged widely, falling from $11 during the worst of the Great Recession, then rising to around $66 in 2018, and then falling all the way back down to less than $22 in 2020 before rising back to around $47 now.

That means shares are up about 33% since the start of 2007, meaning your $5,000 investment would be worth around $6,650 now. If you'd reinvested your dividends along the way, you'd have about $10,200. While that is a gain, it's really nothing special when you consider that a $5,000 investment in the S&P 500 in 2007 would be worth more than $18,000 now, including dividend reinvestments.