The S&P 500 fell for a fourth day and the Nasdaq dropped on Wednesday after a rare earnings stumble from Apple, while strong results from Boeing and Caterpillar lifted the Dow.
The world's largest maker of construction machines also raised its 2012 forecast.
"Expectations have been very low and this is a huge positive for the market," said Jack Ablin, chief investment officer at Harris Private Bank in Chicago.
Hope that the Federal Reserve will act soon to provide more stimulus to the economy also supported stocks. A report in The Wall Street Journal on Tuesday said Fed officials may be moving closer to taking more steps to aid the flagging economy.
Because of those expectations "bank stocks are performing relatively well," said Thomas Villalta, portfolio manager for Jones Villalta Asset Management in Austin, Texas. The KBW bank index <.BKX> was up 0.5 percent.
The Dow Jones industrial average <.DJI> rose 58.73 points, or 0.47 percent, at 12,676.05. The Standard & Poor's 500 Index <.SPX> was down 0.42 point, or 0.03 percent, at 1,337.89. The Nasdaq Composite Index <.IXIC> was down 8.75 points, or 0.31 percent, at 2,854.24.
Housing stocks ranked among the worst performers on data for June showed the biggest drop in U.S. single-family home sales in more than a year. The PHLX housing sector index <.HGX> tumbled 3 percent, pulled lower by a 3.7 percent drop in D.R. Horton shares to $17.98.
The S&P 500 once again tested its 50-day moving average around 1,332. The benchmark index broke through that level on Tuesday but rebounded above it after reports the Fed was likely to provide more stimulus.
Boeing also helped the Dow when it reported a larger-than-expected increase in second-quarter profit and raised its full-year earnings forecast. The company said rising airplane deliveries offset higher pension costs. Boeing's stock gained 2.8 percent to $74.03.
Sixty-three percent of S&P 500 companies have surpassed earnings expectations so far, just a touch above the 62 percent long-term average, Thomson Reuters data showed.
Ford Motor Co reported a better-than-expected second-quarter profit but roughly doubled its forecast for losses in Europe where a deepening economic crisis pushed the auto industry's sales to their lowest level in nearly 20 years. Ford shares edged down 1 percent to $8.97.
(Additional reporting by Rodrigo Campos; Editing by Kenneth Barry)