Stocks finished the week on an upbeat note yesterday, in a surge created by the prospect that laws governing financial services will be rewritten to allow mergers among banks, securities firms and insurance companies.

But Wall Street analysts said the momentum, which wiped out Thursday's 94-point loss and pushed up the Dow Jones industrial average by 172.56 points to 10,470.25, was broader than just the financial sector.

"I'm not sure I would say the banking bill is responsible for a market where there are two times as many stocks going up as going down," said Walter G. Murphy Jr., senior international market analyst for Merrill Lynch & Co.

Murphy said that as of last Friday about 500 stocks were at new 52-week lows, the largest number since a year ago. And this week, he said, another 300 to 400 stocks hit new 52-week lows. "I think clearly the market was oversold," said Murphy, who said that led to the rebound.

The rally yesterday wiped out the market's steep dive Thursday when International Business Machines warned that year 2000 computer glitch fears were hurting its sales of high-end servers, powerful computers that run office networks. At one point on Thursday, the Dow was down 213 points, and IBM's stock fell 16 to 91. By the end of yesterday's session, the Dow was up 450.54 points--or 4.5 percent--for the week, and IBM had recovered 2-15/16 of its previous day's loss.

The Standard & Poor's 500-stock index was up 4.9 percent for the week, and the technology-heavy Nasdaq composite index was up 3.8 percent. The gains in the Dow and the S&P were their biggest weekly increases since early July.

Not all the news was positive yesterday, however. Gillette, the world's largest maker of razors and blades, watched its stock drop by as much as 10.6 percent yesterday before recovering some to close down 1 7/8, or 5 percent at 36. Gillette's shares fell in response to a company warning that its fourth-quarter profit would be hurt by its decision to cut shipments to reduce inventories.

Murphy said that the market's recovery was attributable to the banking bill news, the fact that most technology stocks remained strong and the dollar's strength. Although the dollar closed lower against the yen, it was sharply higher against Europe's single currency as prospects dimmed for a European interest rate increase soon.

Peter Canelo, U.S. investment strategist with Morgan Stanley Dean Witter, noted that the bank index was up 4 percent yesterday. "That's huge," he said.

Bank stocks American Express, J.P. Morgan & Co. and Citigroup--three of the 30 stocks in the Dow average--posted solid gains yesterday, as did insurance stocks, including Travelers Property Casualty, Chubb and Hartford Life. J.P. Morgan, American Express and Citigroup accounted for about a third of the gain in the Dow average.

Canelo said the market enjoyed a major boost from the prospect of financial services mergers after House and Senate negotiators reached a deal early yesterday morning laying the groundwork for passage of a banking overhaul bill. Banks have been underperfoming the market for the last year and three months, he said. "I think this may be a great trigger that prompts people to look at this very, very cheap sector," he said. "We've seen the bottom in banks."

But Canelo said that he also believes that the whole market may have been at or near the bottom, setting the stage for a rebound.

"We've certainly had corrections in just about everything," he said.