Hewlett-Packard has no problem spending money on deals.

But making money on them? That’s the rub.

On Wednesday, the technology giant disclosed that it would have to take an $8 billion charge related to the acquisition of Electronic Data Systems, a $13.9 billion purchase it made four years ago. It’s the latest setback for the struggling computer maker, where a string of acquisitions have fallen flat.

“We expected a big write-down, but not one this big,” said Peter Misek, a Jeffries analyst. “It just means they overpaid — by a lot.”

Over the last decade, H.P. has aggressively spent on deal-making, paying billions of dollars for businesses like E.D.S., Palm, Compaq and, more recently, Autonomy, the enterprise software company. According to data compiled by Jayson Noland, a Robert W. Baird & Company analyst, H.P. has spent more than $67 billion on acquisitions since 2001. That’s almost double H.P.’s current market value of $38 billion. (See chart below.)

Shares of H.P. gained 2 percent on Wednesday, to close at $19.41.

“They buy at least a company a month, and they have struggled to get this right,” Mr. Noland said. “The small ones have been pretty successful, but they’ve had a hard time integrating the larger ones.”

In recent years, the missteps have been costly ones.

In April 2010, for instance, the company announced plans to buy Palm, the troubled handset maker, for $1.2 billion. At the time, Todd Bradley, an H.P. executive vice president, praised webOS, Palm’s mobile operating system, calling it “innovative” and an “ideal platform for H.P.’s mobile strategy.”

One year later, H.P. announced plans to close its webOS device business in the face of mounting pressure from rivals like Apple and Google. The reversal cost H.P. $1.7 billion.

“Palm in particular was one of the most egregiously poor acquisitions,” said Mr. Misek of Jeffries. “It set a new land speed record for destroying shareholder value.”

In the case of E.D.S., H.P. initially found success by slashing costs and improving margins. The business, which offers consulting services to enterprise clients on a contract basis, is H.P.’s second-largest revenue generator next to its computer business. But the services segment has been slow to innovate, according to analysts. Indian rivals, like Tata Consultancy Services and Wipro, have also accepted lower-priced contracts, putting a squeeze on margins. Though I.B.M., another rival, has not been immune to these industry shifts, it has focused on higher-margin, strategic consulting services.

H.P. meanwhile, is still playing catch-up in this arena. The company’s chief executive, Meg Whitman, has said that the services business will focus on higher-margin contracts in the future.

“They are trying to prune the business of unprofitable contracts and shift it to higher-margin areas of the business that require more expertise,” Mr. Noland said. “So you’re talking about hiring new people, retraining employees and that doesn’t happen overnight.”

Analysts are also growing bearish on H.P.’s $10 billion purchase of Autonomy, a British data analytics company that was bought in late 2011. (The deal could be worth up to $11.7 billion, if the company meets certain targets.) The acquisition, which many experts have described as too expensive, has started to sour on H.P.’s vine. In a May earnings call, Ms. Whitman described Autonomy’s quarter as “disappointing,” with a “significant decline year over year resulting in a shortfall to our expectations.”

In part, H.P.’s recent M.&A. blunders are linked to its management shuffles, which have whipsawed the company in multiple directions. In the last three years, H.P. has been led by three different chief executives: Mark Hurd, who presided over the Palm and E.D.S. acquisition, left in late 2010 in the wake of a sexual harassment claim; Léo Apotheker, who led the $10 billion deal for Autonomy; and Meg Whitman, who reversed Mr. Apotheker’s direction by deciding to keep H.P.’s personal computer business.

So far, Ms. Whitman, the former eBay chief executive, has spent more time on cost-cutting than deal-making. But she is considered a very active dealmaker. During her tenure at the online auction house, she completed 40 acquisitions worth nearly $10 billion.

Then again, H.P. — after a long shopping spree — may not have the money to do a lot more. Its cash has dwindled to about $8 billion, from $13 billion in 2009.

“At least shareholders don’t have to worry about another large acquisition from H.P.,” Mr. Noland said.