Banks are complex institutions, but a simple and quick calculation reveals Bank of America (BAC 1.53%) may have had a better financial quarter than anyone is willing to give it credit for.

The costs mount up
Bank of America announced earnings this week, logging its first quarterly loss since 2011 as a result of more than $6 billion in legal costs, which were announced earlier in the year. This resulted in many questioning the enduring value of the bank, and whether or not the company would ever be able to put its legal woes behind it.

Piling on to the bad news, Reuters ran a story titled Bank of America's Mortgage Crisis Costs Become A Recurring Problem, resulting in the stock falling by more than 3.5% in the before rebounding later in the afternoon to finish the day down 1.5%.

And while many believe Bank of America had a poor quarter, one number reveals a dramatically different result.

The simple calculation
As shown in the chart below, when considering Bank of America's profitability after excluding litigation costs, from the first quarter of last year relative to the first quarter of this year, the bank exhibited significant improvement:


Source: Company Investor Relations

Even with the dip in revenue, as a result of reduced expenses and lower provision for credit losses -- what the bank anticipates it will lose on its loans -- pre-tax income at Bank of America rose by an astounding 28%, casting the first quarter in a strikingly different light.

While the drop in revenue is noteworthy, it must be mentioned its noninterest income was flat even despite an $850 million drop in its mortgage banking income. And the fall in net interest income was the result of both its interest yield falling from 2.36% to 2.29% and continued efforts to reduce its size.

While a drop of seven basis points doesn't sound like a lot, if it had been able to earn that difference on its $1.8 trillion in earning assets, it would've seen $350 million more in net interest income.

Looking up
The legal expenses at Bank of America should be recognized as money that, instead of being returned to shareholders, is paid to those who have settled court cases. However when considering Bank of America as an investment, one has to think of it not over the next few quarters -- when perhaps more litigation costs may arise -- but instead the next few years.

With that in mind, a continued ability to grow its bottom line is certainly a sign of optimism for investors.