Investment banking giant Goldman Sachs (GS 1.78%) has had a rough go of it over the last year. With a dramatic drop in the number of companies going public through initial public offerings (IPOs) and a challenging market environment, things haven't been easy for the bank.

On paper, Goldman Sachs may look like a bargain, but I'm not buying this investment bank anytime soon. Here's why, plus another banking giant I like instead.

The worst year for IPOs in 30 years

Investment banks struggled last year. That was a stark contrast to the prior year when deal activity was the highest on record.

At the root of the problem was that companies didn't want to go public or make many deals with so much uncertainty in the air. For one, Russia's invasion of Ukraine added geopolitical uncertainty, resulting in skyrocketing energy and food prices. Moreover, the Consumer Price Index (CPI) in the U.S. was already showing year-over-year price increases of 7% -- the highest since the 1980s.

High inflation forced the Federal Reserve to take action using its primary policy tool, the federal funds rate. The Fed raised interest rates several times, bringing its benchmark rate from near-zero up to 4.5% in less than 10 months.

Interest rates haven't risen this dramatically in decades, and it caused a repricing across all assets as bonds became attractive alternatives to stocks for the first time in a while. This repricing hit public and private valuations, and companies thought it was best to stay on the sidelines until the dust settled. What resulted was the the worst year for IPOs since 1990, according to data from Refinitiv. 

Goldman Sachs' income was cut in half

Every major investment bank saw earnings decline last year, but Goldman Sachs was one of the worst hit. Its revenue dropped 20% during the year, while net earnings plunged 49%. Leading the way lower was a 48% drop in investment banking fees, mainly due to fewer equity and debt underwriting deals; fewer mergers and acquisitions during the year didn't help either.

Others with large investment banking businesses include Morgan Stanley (MS 1.05%) and JPMorgan Chase. These banks have more diversified businesses and didn't see such substantial declines. Morgan Stanley's revenue and net income fell by 10% and 27%, respectively. Meanwhile, JPMorgan's revenue rose by 6%, and its net income fell by 22%. 

Uncertainty around Goldman's consumer business lingers

Another hitch in Goldman Sachs' journey was its consumer banking business, which didn't grow in quite the way it expected. From 2020 through the third quarter of last year, Goldman's consumer business lost more than $3 billion.  

CEO David Solomon said during the recent earnings call, "we tried to do too much too quickly." Not only did it pour billions of dollars into this failed segment, but now the Federal Reserve is investigating whether the investment bank had the proper safeguards in place to protect consumers, according to The Wall Street Journal

I'd buy this investment bank over Goldman today

Goldman Sachs trades at a relatively cheap valuation, with a one-year forward price-to-earnings ratio of 8.7. However, investment banks will continue to face headwinds through the first part of the year as conditions will still make it a tough market for companies going public. Even when deal activity does pick up, it will likely begin with a trickle, as only the highest-quality companies will test the waters to go public.

However, one investment bank I like today is Morgan Stanley. The company has done an excellent job of building out its investment and wealth management businesses, giving it more excess capital than its peers. Morgan Stanley will benefit from a pickup in deal activity and its diversified business is less capital-intensive. This can help it traverse uncertain market conditions better than Goldman Sachs, which still has unanswered questions about its consumer banking business.