(AP) -- Major U.S. indexes closed mostly higher Friday, and several of them notched weekly gains, despite a recent run of daily swings on Wall Street as traders try to figure out what's next for the economy.
The S&P 500 index rose 0.5% after spending the day veering between a gain of 0.6% and a 0.4% decline. The Dow Jones Industrial Average rose 0.4%, while the Nasdaq composite fell 0.2%.
The indexes alternated nearly every day this week between gains and losses. Investors are trying to suss out what's next for inflation and the global economy as the repercussions of Russia's invasion of Ukraine continue to play out.
The benchmark S&P 500 posted a 1.8% gain for the week. That follows a 6.2% rise last week. The tech-heavy Nasdaq and Dow have also posted a weekly gain now the past two weeks.
Bond yields rose significantly. The yield on the 10-year Treasury jumped to 2.48% from 2.34% late Thursday. Crude oil prices rose moderately after slipping earlier in the day.
"We're still in this relatively neutral outlook right now, trying to digest what's happening at the Federal Reserve, watching events in Russia-Ukraine and then getting ready for the first-quarter earnings season," said Tom Hainlin, national investment strategist at U.S. Bank Wealth Management.
The S&P 500 rose 22.90 points to 4,543.06. The Dow gained 153.30 points to 34,861.24, and the Nasdaq fell 22.54 points to 14,169.30.
Smaller company stocks also rose. The Russell 2000 index added 2.54 points, or 0.1%, to 2,077.98.
Banks and energy stocks accounted for a big share of the S&P 500's gains. The rise in bond yields helped lift banks, which rely on higher yields to charge more lucrative interest on loans. Bank of America rose 1.5%.
Technology stocks fell and checked gains elsewhere in the market. Big technology companies have outsized values that tend to lend more weight in pushing the broader market higher or lower. Chipmaker Nvidia fell 1.6%.
The price for U.S. benchmark crude oil rose 1.4% to settle at $113.90 per barrel, while a barrel of Brent crude, the international standard, rose 1.4% to $120.65. Prices are still up about 50% globally for the year. The pickup in oil prices helped lift energy stocks. Exxon Mobil gained 2.2%.
Oil prices have been volatile since Russia's war against Ukraine began in February. Russia is the second-biggest crude exporter. Energy prices were already high, but the conflict has raised concerns about a worsening supply crunch that could maker persistently rising inflation even worse.
The U.S. and Europe announced a partnership Friday to reduce the continent's reliance on Russian energy in hopes of further isolating Moscow for its aggression. Russia has threatened to make Europe pay for natural gas exports in rubles, which has seen its value gutted because of sanctions and other actions. Russia's economy has been battered as governments cut it off from international banking and commerce.
The conflict in Russia has added to global concerns about rising inflation and the potential for economic growth to slow even more than anticipated. A survey on Friday showed that business confidence in Germany, Europe's largest economy, dropped sharply in March because of conflict in Ukraine.
Central banks, including the Federal Reserve, are moving to raise interest rates to try and temper the impact from rising inflation, which has only been made worse by Russia's war in Ukraine. The conflict is also pushing wheat and other commodity prices higher, as both Russia and Ukraine are major global suppliers.