Mergers and acquisitions have surged this month with megadeals for iconic companies such as Dell Inc. and H.J. Heinz Co., fueling optimism that more buyers are ready to embrace $10 billion pricetags.

Almost $40 billion in deals were announced yesterday, led by Heinz’s $23 billion takeover by Berkshire Hathaway Inc. and 3G Capital, data compiled by Bloomberg show. Transaction volume has increased by 27 percent so far this year compared with the same period a year earlier, signaling buyers are willing to spend again following last year’s mergers slump.

Record corporate profits and cheap borrowing costs are attracting buyers even as stock prices soar to a five-year high, with more than $140 billion of announced M&A deals this month, data compiled by Bloomberg show. The past two weeks alone have yielded at least four deals worth more than $10 billion each, including the Heinz and Dell buyouts and Comcast Corp.’s $16.7 billion purchase of General Electric Co.’s stake in NBC Universal.

“The Goldilocks era of post-crisis M&A has never been an if, but a when,” said JPMorgan Chase & Co. Vice Chairman James B. Lee, whose firm advised on Dell, Heinz and GE, as well as Liberty Global Inc.’s proposed $16 billion takeover of Virgin Media Inc. “CEOs are declaring that day has come.”

Last year, M&A shrank about 8 percent to $2.21 trillion, according to data compiled by Bloomberg. The one bright spot: The fourth quarter, which was the strongest for deals since 2008, buoyed by Softbank Corp.’s plan to take control of Sprint Nextel Corp. and the proposed combination of T-Mobile USA Inc. and MetroPCS Communications Inc.

Confidence Growing

The completion of the U.S. Presidential election in November and easing financial turmoil in Europe have helped set the stage for larger purchases.

“The Euro zone dynamics, the U.S. elections, the fiscal cliff and debt ceiling, while not in the rear-view mirror, have all taken a back seat to improving fundamentals,” said Paul Parker, Barclays Plc’s head of global corporate finance and M&A.

“Big deals tend to be transformational for industries and the second-order consequences can be very meaningful, often requiring a strategic offensive or defensive response,” he said. Barclays helped Silver Lake Management LLC finance its bid for Dell and is advising on US Airways Group Inc.’s merger with AMR Corp.’s American Airlines.

Debt Capacity

Easy access to cash may help solidify that. Borrowing costs with high-yield bonds, which investors typically use to fund leveraged merger deals, reached a record low in late January. Yields dropped to 6.41 percent on Jan. 25, compared with an average 9.27 percent over the past decade, according to the Bank of America Merrill Lynch U.S. High Yield index. High-risk, high- yield bonds, also known as junk, are rated below Baa3 by Moody’s Investors Service and lower than BBB- at Standard & Poor’s.

“The trigger is that capacity in the debt markets is much bigger than we’ve seen since 2007,” said Mark Stephanz, vice chairman of the global financial sponsors group at Bank of America Corp. “We remain very optimistic about continuous growth in deal volumes throughout the year based on the liquidity we see.” His bank served as an adviser on the Heinz transaction.

Corporate confidence also may play a role in the rebound. Companies in the Standard & Poor’s 500 Index reported earnings per share of $101.38 in the past 12 months, 20 percent more than their level in 2007, the tail end of the previous buyout boom, data compiled by Bloomberg show. About 74 percent of the 386 companies in the S&P 500 that have released results during the earnings season have exceeded profit projections, the data show.

Advisory Fees

The rebound also means big paydays for Wall Street firms. Banks including Centerview Partners, Bank of America, Lazard Ltd. and Moelis & Co. may make as much as $97 million advising on the Heinz deal, valued at $28 billion including debt, according to estimates from Freeman & Co.

Centerview and Bank of America provided guidance to Pittsburgh-based Heinz, while Moelis acted as adviser to the company’s transaction committee. They stand to make as much as $60 million from their work, according to estimates from Lam Nguyen, a director at New York-based research firm Freeman.

Lazard served as lead adviser to the investment group taking over Heinz, while JPMorgan and Wells Fargo & Co. also provided advice. They may receive as much as $37 million, according to the Freeman estimates.

The sale boosts JPMorgan to the top of the M&A league table this year, displacing Goldman Sachs Group Inc., data compiled by Bloomberg show. New York-based JPMorgan has advised on an estimated $96.2 billion of buyouts this year including all of the four biggest, the data show. Goldman Sachs, which wasn’t involved in the Heinz sale, is credited with helping to arrange $75.7 billion of M&A deals this year, the data show.

Centerview’s Role

Centerview has jumped to fourth in market share of announced M&A deals so far this year after advising on Heinz and on Comcast’s purchase of GE’s NBC stake, data compiled by Bloomberg show. The New York-based advisory firm’s share of M&A advisory business so far this year is estimated at $52.8 billion, or 19 percent of all business, compared with $38.5 billion, or less than 2 percent, for all of last year, the data show.

If M&A continues at this pace through the rest of February, it could be the strongest month for transactions since October 2012, according to data compiled by Bloomberg.

“Deals we are seeing today could be reflective of a growing appetite for larger deals,” said Martyn Curragh, U.S. deals leader at PricewaterhouseCoopers LLP. “Momentum is building on positive trends we saw developing last year in low- cost debt, a more stable equity market and continued interest from foreign investors.”