(AP) -- A late-afternoon rally on Wall Street helped stocks close higher Friday, though the major indexes still wound up finishing lower for the week after several days of bumpy trading.
The S&P 500 rose 0.5% after wavering between small gains and losses for much of the day. The Dow Jones Industrial Average rose 0.6% and the Nasdaq composite ended essentially flat after swinging between a 1% gain and an 0.8% drop.
Several big retailers made solid gains after reporting strong quarterly results and gave investors encouraging financial forecasts. Discount retailer Ross Stores surged 9.9% for the biggest gain among S&P 500 stocks, while clothing retailer Gap rose 7.6% after beating analysts' expectations. Foot Locker climbed 8.7% after raising its profit and revenue forecast for the year.
The solid earnings from retailers cap off a shaky week for Wall Street as investors try to get a better sense of inflation's path and its impact on consumers and businesses. Investors have been particularly anxious about the Federal Reserve's fight against inflation and have been looking for signs that might allow the central bank to shift to less aggressive interest rate increases. That anxiety was heightened on Thursday after a Fed official suggested U.S. interest rates might have to be raised higher than expected to cool inflation.
"It's all been the same story for a year," said Keith Buchanan, portfolio manager at Globalt Investments. "It's about what inflation is doing, how the Fed responds, and from there how does the consumer respond."
The S&P 500 rose 18.78 points to 3,965.34. The Dow rose 199.37 points to 33,745.69. The Nasdaq added 1.10 points, or less than 0.1%, to close at 11,146.06.
Smaller company stocks also gained ground. The Russell 2000 rose 10.61 points, or 0.6%, to 1,849.73.
The major indexes all finished down for the week and remain sharply lower so far this year.
Trading has been choppy this month as investors have weighed company earnings reports, economic data and signals from the Federal Reserve as to what the central bank will do next in its fight to lower inflation.
The central bank has already warned that its short-term interest rate may have to rise to a more painful level than anybody had anticipated, possibly between 5% and 7%. The Fed's benchmark rate currently stands at 3.75% to 4%, up from close to zero in March.
The Fed is trying to tame the hottest inflation in decades by making borrowing more difficult and curtailing spending. Several big measures of inflation have shown that prices are easing a bit, but other economic indicators show that consumers remain resilient, as does the jobs market.
The central bank's strategy risks sending the economy into a recession if it hits the brakes too hard on economic growth. The latest mix of inflation and economic data has Wall Street trying to gauge whether the Fed needs to keep pushing along with interest rate increases and whether it can achieve its goal without severely crimping consumer spending or employment.
The U.S. reported this week that retail sales rose 1.3% in October as Americans increase their spending at stores, restaurants, and auto dealers, a sign of consumer resilience as the holiday shopping season begins. That's not to say consumer behavior hasn't been affected by inflation. Major retailers say Americans are holding out for sales, refusing to pay full price, with the cost of gasoline, rent, food and almost everything else much higher than it was last year.
Most of the 11 company sectors in the benchmark S&P 500 rose, with health care and financial stocks accounting for a big share of the gains. UnitedHealth Group rose 2.9% and Charles Schwab added 2.5%.
Losses by energy and communications companies kept the market's gains in check. Marathon Oil fell 1.6% amid a broad pullback in energy prices. U.S. crude oil settled 1.9% lower. Live entertainment promoter and venue operator Live Nation slumped 7.8%.
Several homebuilders and other real estate companies lost ground following a report showing that sales of previously occupied U.S. homes fell in October for the ninth month in a row, the latest sign that the housing market is slowing as homebuyers grapple with sharply higher mortgage rates, rising home prices and fewer properties on the market. Zillow Group fell 5.5% and homebuilder Hovnanian Enterprises slid 0.7%.
European markets closed higher. Asian markets closed mixed overnight.
Bond yields rose. The yield on the 10-year Treasury, which influences mortgage rates, rose to 3.82% from 3.77%.