Stocks closed higher on Wall Street Friday after a day of wobbling between gains and losses.

Even so, the S&P 500 index wound up with its biggest weekly drop since late March. The market’s enthusiasm was checked by more grim data showing how badly the coronavirus pandemic is crippling the economy.

Communications, health care and technology stocks accounted for much of the gains. Chipmakers were among the biggest losers after the U.S. government moved to impose new restrictions on Chinese tech giant Huawei.

On Friday:

The S&P 500 rose 11.20 points, or 0.4%, to 2,863.70.

The Dow Jones Industrial Average gained 60.08 points, or 0.3%, to 23,685.42.

The Nasdaq composite added 70.84 points, or 0.8%, to 9,014.56.

The Russell 2000 index of smaller companies climbed 19.44 points, or 1.6%, to 1,256.99.

For the week:

The S&P 500 fell 66.10 points, or 2.3%.

The Dow dropped 645.90 points, or 2.7%.

The Nasdaq slid 106.76 points, or 1.2%

The Russell 2000 gave up 72.65 points, or 5.5%.

For the year:

The S&P 500 is down 367.08 points, or 11.4%.

The Dow is down 4,853.02 points, or 17%.

The Nasdaq is up 41.95 points, or 0.5%

The Russell 2000 is down 411.48 points, or 24.7%.