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.
Apple Inc
Shares fell 4.3% to $574.97. Without Apple's losses, the S&P would have ended higher.
The price-weighted Dow industrials managed gains thanks to Caterpillar
The world's largest maker of construction machines also raised its 2012 forecast.
Also Read
"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 was up 0.5%.
The Dow Jones industrial average rose 58.73 points, or 0.47%, at 12,676.05. The Standard & Poor's 500 Index was down 0.42 point, or 0.03% at 1,337.89. The Nasdaq Composite Index was down 8.75 points, or 0.31%, at 2,854.24.
Housing stocks ranked among the worst performers on data for June showed the biggest drop in US single-family home sales in more than a year. The PHLX housing sector index tumbled 3 percent, pulled lower by a 3.7%drop in D.R. Horton
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% to $74.03.
Sixty-three percent of S&P 500 companies have surpassed earnings expectations so far, just a touch above the 62% long-term average, Thomson Reuters data showed.
Ford Motor Co
After the closing bell, shares of Internet company Zynga
Shares of Visa
Volume was about 6.43 billion shares on the New York Stock Exchange, the Nasdaq and Amex, compared with the year-to-date daily average of 6.74 billion shares.
Advancers beat decliners on the NYSE by about 16 to 13 and on the Nasdaq by about 7 to 5.