Over the last year through July 18, the S&P 500 index has gained 13.6%. However, while certain stocks have done well, others have lagged.
Home Depot (HD 1.95%) and PepsiCo (PEP 3.13%), two well-known companies, have been laggards. They have lost 1.8% and 15.9%, respectively, during this time.
The market seems to have become concerned about short-term issues while ignoring the business' long-term strengths. That provides an opportunity for investors, who should get rewarded for their patience. In the meantime, you can collect dividends while waiting for their results and stock prices to recover.

Image source: Getty Images.
1. Home Depot
Many homeowners and professional contractors shop at Home Depot. The largest home-improvement retailer offers convenience and competitive prices.
Its results can be sensitive to the economy, and more specifically, the housing cycle. Macroeconomic factors, such as interest rates, housing sales, and employment affect Home Depot's sales.
Right now, people have been holding off on major home projects as high prices for things like food and housing eat away at discretionary income. Additionally, elevated interest rates have made borrowing, and hence large renovations, more costly, causing people to put them on hold.
That's certainly hurt Home Depot's top line. Fiscal first-quarter same-store sales (comps) fell 0.3%, although foreign-currency translations subtracted 0.7 percentage points. The period ended on May 4.
However, at some point, homeowners will proceed with renovations. It's just a matter of time before people remodel the kitchen or bathroom, for instance. When they do, it seems likely they'll return to Home Depot.
In the meantime, shareholders can enjoy the 2.6% dividend yield, more than double the S&P 500's 1.2%.
The board of directors also has a history of increasing payments. It has boosted dividends every year since 2010. Even during the Great Recession, Home Depot kept payments constant from 2007 through 2009.
Aside from prioritizing dividends, the company has the wherewithal to keep making payments. Management expects this year's diluted earnings per share to fall about 3% from $14.91. That works out to about $14.26 a share, which would easily cover the $9.20 annual dividend.
2. PepsiCo
PepsiCo has a stable of beverage and convenience food brands. These include Pepsi, Gatorade, Doritos, and Quaker.
Nonetheless, sales have been sluggish, hurt by consumers weary from overall price increases. PepsiCo recently reported second-quarter results. Adjusted sales, which remove foreign-currency translation effects and acquisitions/divestitures, rose 2%. However, volume remained under pressure, subtracting 1.5 percentage points, while price increases were responsible for a 4-percentage-point increase.
Management continues to expect low-single-digit-percentage revenue growth this year. The market seemed relieved by these results, sending the stock price up 7.5% following the earnings release.
While that's encouraging, PepsiCo can't rely solely on price increases to drive revenue growth. It will need to boost volume. Based on its well-established brands that have a strong presence in the marketplace, I expect that it will happen once consumers get their bearings.
Meanwhile, management and the board of directors certainly have confidence in PepsiCo's long-term future. Earlier this year, it increased the quarterly dividend by 5%. It looks like the company can easily cover the $5.69 annual rate since it expects adjusted EPS to come in above $8.
PepsiCo has an impressive dividend history that not many other companies can claim. The recent increase ran its streak to 53 straight years, making the company a Dividend King. The stock has an attractive 4% dividend yield.