After two days of huge losses, U.S. stocks ended back where they started Tuesday. Energy companies sank as crude oil plunged 7 percent, but technology and consumer-focused companies climbed.

On Tuesday:

The S&P 500 index inched up 0.22 points to 2,546.16.

The Dow Jones Industrial Average clawed back 82.66 points, or 0.4 percent, to 23,675.64.

The Nasdaq composite rose 30.18 points, or 0.4 percent, to 6,783.91.

The Russell 2000 index of smaller companies slipped 0.97 points, or 0.1 percent, to 1,377.18.

For the week:

The S&P 500 is down 53.79 points, or 2.1 percent.

The Dow is down 424.87 points, or 1.8 percent.

The Nasdaq is down 126.75 points, or 1.8 percent.

The Russell 2000 is down 33.64 points, or 2.4 percent.

For the year:

The S&P 500 is down 127.45 points, or 4.8 percent.

The Dow is down 1,043.58 points, or 4.2 percent.

The Nasdaq is down 119.48 points, or 1.7 percent.

The Russell 2000 is down 158.34 points, or 10.3 percent.