US stocks shook off early declines and closed out the last trading day of the month with modest gains on Friday as a rise in Microsoft helped offset declines in Amazon and Apple after disappointing quarterly earnings from the online retailer and iPhone maker.
Microsoft Corp's shares closed at a record high of $331.62 and ended the session with a market capitalization of $2.49 trillion, surpassing Apple Inc's market cap of roughly $2.48 trillion.
Apple lost 1.81% after it warned the impact of supply-chain disruptions will be even worse during the current holiday sales quarter, while Amazon.com Inc declined 2.15% as it forecast downbeat holiday-quarter sales amid labor shortages.
"The takeaway from today is the resilience to the overall index despite 10% of market cap in two companies disappointing and yet the market is flat. It’s the resilience of the marketplace, it suggests to me the trend is still intact," said David Joy, chief market strategist at Ameriprise Financial in Boston.
"Maybe the numbers were a surprise to the analyst community but not the reasons for the disappointment so there is still a general view that this is not business lost but business postponed and the trend in the economy and in the market continues to be to the upside."
The S&P 500 had fallen as much as 0.65% earlier in the day.
The benchmark index advanced 1.3% for the week, its fourth straight weekly climb, marking its longest weekly streak of gains since April. For the month, the S&P rose 6.9%, its biggest monthly rise since November 2020.
The Dow rose 0.4% for the week while the Nasdaq gained 2.7%, also marking four straight weekly gains for each. The Dow climbed 5.8% for October, its best monthly performance since March, while the Nasdaq jumped 7.3% for its biggest monthly percentage gain since November 2020.
Apple had risen about 2.5% while Amazon gained 1.6% in Thursday's session, helping to send the S&P 500 and Nasdaq to closing record highs.
With 279 companies in the S&P 500 having reported results through Friday morning, 82.1% have topped earnings expectations, according to Refinitiv data. The current year-over-year earnings growth rate for the third quarter is 39.2%.
Market participants have been closely attuned to the ability of companies to maneuver through labor shortages, rising price pressures and clogs in the supply chain, and a solid earnings season has helped investors overlook a mixed macroeconomic picture with a Federal Reserve that is poised to begin to trim its massive bond purchases soon.
The central bank's next policy announcement is on Nov. 3.
Data showed U.S. consumer spending increased solidly in September, while inflation pressures are broadening.
The data indicated the jury is still out on whether the Fed's "transitory" view on inflation will hold true.
AbbVie Inc advanced 4.56% as the U.S. drugmaker raised its 2021 adjusted profit forecast for the third time this year.
Starbucks Corp tumbled 6.30% after the coffee chain said it expects fiscal 2022 operating margin to be below its long-term target due to inflation and investments.
Declining issues outnumbered advancing ones on the NYSE by a 1.14-to-1 ratio; on Nasdaq, a 1.02-to-1 ratio favored advancers.
The S&P 500 posted 50 new 52-week highs and 4 new lows; the Nasdaq Composite recorded 127 new highs and 78 new lows.
Volume on U.S. exchanges was 11.12 billion shares, compared with the 10.35 billion average for the full session over the last 20 trading days.