The S&P 500 just wrapped another winning month.

The broad-market index finished July up 3.1%, though it was actually the worst-performing of the three major indexes as the chart below shows.

^SPX Chart

^SPX data by YCharts.

For the year, the S&P 500 is now up 19.5%, and according to some, the index is back in a bull market. In fact, the S&P is just 4% below the all-time high reached in early 2022, meaning the index could easily break back into record territory by the end of the year.

However, not every stock was a winner last month. Let's take a look at the three worst-performing stocks in July on the S&P 500 to see if any of them are worth buying.

1. Equifax (down 13.3%)

Equifax (EFX -1.26%), the company that is best known for its credit reporting, was the worst performer on the S&P 500 last month, falling 13.3% after it delivered a disappointing second-quarter earnings report.

Equifax shares fell 9% on July 20 after the report came out, and the stock continued to slide from there. 

Revenue in the quarter was flat at $1.32 billion due in part to a decline in mortgage applications. That figure matched analyst estimates.  

Profits in the quarter fell as the company struggled with higher costs for technology and labor, and earnings per share (EPS) were down from $1.63 to $1.12, which was well below analyst estimates at $1.67.

Even worse, the company cut its guidance for the year due to weakness in the mortgage market as it now expects mortgage originations, a key source of its business, to decline by 37%, or five percentage points lower than its previous forecast. 

It now sees full-year revenue of $5.27 billion to $5.33 billion, down from an earlier range of $5.275 billion to $5.375 billion, and it cut its EPS forecast from a range of $7.05 to $7.35 to a lower range of $6.85 to $7.10.

Equifax now trades at a forward price-to-earnings (P/E) ratio close to 30, and with interest rates moving higher, it could be several years before the mortgage market shows a significant recovery. Taking that into account, the sell-off doesn't look like a buying opportunity.

2. Ford Motor (down 12.7%)

Ford Motor Company (F -1.92%) has gotten a lot of attention from investors this year as it ramps up its efforts in electric vehicles (EVs), but the stock pulled back double digits in July in large part because it cut its prices on its electric Lightning F-150 trucks by $10,000 to less than $50,000. 

The stock fell 6% on the news, the latest sign that competition is intensifying in the EV industry and that margins are likely to come down.

Earlier in the year, Ford cut prices on its Mustang Mach-E electric SUV as well. 

In its Q2 earnings report, Ford topped estimates on the top and bottom lines with revenue up 12% to $45 billion, and adjusted EPS up from $0.68 to $0.72, beating expectations at $0.55.

However, management said that EV adoption in the industry would be slower than expected, and it would slow its ramp-up in production, pushing back its goal of making 600,000 EVs from this year until next year. It also forecast a $4.5 billion operating loss in EVs this year, up from $3 billion previously.

That overshadowed the otherwise strong results, and the stock fell again. While Ford's overall profitability is impressive, investors seem likely to be skeptical of the stock until it can prove its EV strategy is paying off.

3. Universal Health Services (down 12%)

Hospital operator Universal Health Services (UHS 0.58%) was another loser last month as the company beat estimates with its Q2 earnings report, but investors still seemed to be disappointed.

Overall revenue increased 6.8% to $3.55 billion in the period, topping expectations at $3.5 billion, and adjusted EPS rose from $2.20 to $2.53, ahead of the consensus at $2.43.

Universal Health Services also raised the bottom end of its full-year EPS guidance range from $9.50 to $9.85, keeping the top end at $10.50.

Still, growth in patient days in its behavioral healthcare segment slowed to just 1.5%, and that seemed to weigh on the stock. Analysts were also disappointed by the lack of significant margin expansion.

Based on its elevated guidance, the stock trades at a forward P/E of 14, which is not a bad price to pay for this steady grower in a recession-proof industry. Universal Health Services is worth adding to your watchlist to buy if the pullback continues.