Shares of manufacturers and banks pulled the Dow Jones Industrial Average higher Wednesday following new data showing consumer prices rose further last month.

Home Depot, Goldman Sachs and Caterpillar’s stocks all rose, helping to lift the blue-chip index 170 points in recent trading, putting the Dow on track to notch another record close. The S&P 500 held on to a slimmer gain, rising 0.1%, also putting the index on track for a fresh closing high. Tech stocks lagged behind, meanwhile, bringing the Nasdaq Composite down 0.5%.

Investors gravitated toward stocks that are more closely tied to the economic cycle, such as banks and manufacturers, after new data showed consumer prices rose again last month. However, unlike previous months, the data was largely in line with expectations.

The U.S. consumer-price index gained 5.4% in July from a year earlier, coming in just above analysts’ forecasts of a 5.3% increase. More important, the core rate of inflation, CPI, rose by 0.3%—below the 0.4% increase expected—after excluding energy and food prices.

“For now, the streak of outsized inflation surprises is over,” said Jefferies economists in a note following the data’s release. “However, it remains to be seen whether the period of elevated price pressure is truly over.”

Seema Shah, chief strategist at Principal Global, added that while the report should help reassure markets that inflation isn’t on a relentless upward trajectory, the report is still hot. That view likely contributed to investors moving more money into cyclical value stocks on Wednesday and out of shares of technology companies and other fast-growing stocks.

“Surely, a deep-dive discussion into tapering will be on the top of [the Federal Reserve’s] agenda” at the central bank’s September meeting, Ms. Shah added.

On Wednesday, shares of industrial firms in the S&P 500 rose 0.8%, while financial companies added nearly 1%. The latter got a boost from an uptick on bond yields, which generally mean higher profits for banks. The yield on the 10-year Treasury note rose to 1.360% from 1.342% Tuesday.

Related Video

The U.S. inflation rate reached a 13-year high recently, triggering a debate about whether the country is entering an inflationary period similar to the 1970s. WSJ’s Jon Hilsenrath looks at what consumers can expect next. The Wall Street Journal Interactive Edition

Within the Dow, Home Depot led the blue-chip benchmark higher, gaining nearly 2% in recent trading. Goldman Sachs added 1.2%, while Caterpillar gained 1.8%.

Meanwhile, Coinbase Global shares added 6.8% after the cryptocurrency exchange posted growing revenue and usage. They were also boosted by a rally in cryptocurrencies, which powered ahead early Wednesday.

Energy stocks in the S&P 500 stumbled 0.4% following reports that the White House would call on OPEC and its oil-producing allies to boost production. Brent crude, the international oil benchmark, fell 0.8% to $70.04 a barrel on the news.

Other laggards in the S&P 500 included tech stocks, down 0.3%, shares of healthcare firms, off 0.7%, and consumer-discretionary stocks, down 0.1%.

Investors are also awaiting another spate of corporate earnings. Bumble and eBay are expected to report after the market closes. A strong earnings season, which is winding down, has supported the stock market in recent weeks, money managers say.

“Earnings have been amazing,” said Altaf Kassam, head of investment strategy for State Street Global Advisors in Europe. “They’ve really over-delivered this time, so there’s a lot of good reasons for the equity market to be where it is.”

Overseas, the pan-continental Stoxx Europe 600 edged up 0.4%. China’s Shanghai Composite ticked 0.1% higher and Japan’s Nikkei 225 added almost 0.7%. South Korea’s Kospi fell 0.7%.

The S&P 500 and Dow Jones Industrial Average hit record closes on Tuesday.

Photo: Spencer Platt/Getty Images

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com and Michael Wursthorn at Michael.Wursthorn@wsj.com