Stocks rose Friday with the Dow Jones Industrial Average and S&P 500 closing out their third week of gains in a row as the Federal Reserve's preferred inflation gauge showed cooling inflation in July. The Dow climbed over 170 points higher, while the S&P 500 and Nasdaq Composite added about 1% and 2%, respectively.

Here's how the market settled to close out the week:

S&P 500 Index (SPY  ): +0.99% or +44.82 points to 4,582.23

Dow Jones Industrial Average (DIA  ): +0.50% or +176.57 points to 35,459.29

Nasdaq Composite Index (QQQ  ): +1.90% or +266.55 points to 14,316.66

While Wall Street is coming off a losing session, all three major averages ended the week with gains as investors celebrated data showing cooling inflation and stronger-than-expected earnings. The Dow added 0.66% this week, while the S&P 500 and Nasdaq rose 1.01% and 2.02%, respectively.

In the spotlight, the Personal Consumption Expenditures (PCE) Price Index released Friday showed prices grew at their slowest pace in about two years in June. Last month's PCE rose 3.0% year-over-year, down from 3.8% in May and coming in-line with expectations.

Core PCE, which strips away food and energy prices and is the Federal Reserve's preferred inflation measure, grew 4.1% in June, below 4.6% in May and below 4.2% expected by economists. The Fed's target inflation is 2% annually.

The second-quarter earnings season is still hot going into Friday, with Dow member Procter & Gamble (PG  ) shares rising after the consumer goods company topped earnings and revenue expectations. Roku (ROKU  ) soared 25% after beating estimates on both top and bottom lines, while Exxon Mobil (XOM  ) shares fell following a second-quarter earnings miss.

Intel (INTC  ) shares rose as the chipmaker returned to profitability after two straight quarters of losses. Still, Intel CEO Pat Gelsinger said on a call with analysts that the company sees "persistent weakness" in all business segments through year-end, and its server chip sales are not expected to recover until the fourth quarter.

Ford (F  ) shares were lower Friday despite the automaker's earnings beat and increased guidance as electric vehicle adoption is coming at a slower-than-expected pace. The company said it expected to lose $4.5 billion on its EV business in 2023, which would come below the losses of about $3 billion last year. Other EV stocks like Tesla (TSLA  ), Lucid (LCID  ) and Xpeng (XPEV  ) rose following Ford's report.

Elsewhere, consumer sentiment came in at its highest level in nearly two years in July's final print, the University of Michigan reported on Friday. The consumer sentiment index ticked lower to 71.6 from July's preliminary reading of 72.6, but remained higher than June's print of 64.4 and July 2022's reading of 51.5. This latest reading is also the highest for the index since October 2021.

"Overall, the sharp rise in sentiment was largely attributable to the continued slowdown in inflation along with stability in labor markets," said Joanna Hsu, director of Surveys of Consumers, in a statement. "However, sentiment for lower-income consumers fell. This group anticipates that inflation and their income prospects will both worsen in the year ahead, highlighting the heterogeneity of views across the population."

Looking ahead, next week will see a new batch of second-quarter earnings reports from companies including Pfizer (PFE  ), Apple (AAPL  ), Amazon (AMZN  ), Advanced Micro Devices (AMD  ), Caterpillar (CAT  ), Starbucks (SBUX  ), Uber Technologies (UBER  ), PayPal (PYPL  ), CVS Health (CVS  ), and Qualcomm (QCOM  ).