The S&P 500 has gained about 27% over the past year. In the wake of such significant market moves, it's easy to suspect that you've missed out on your chance to profit. That need not be the case, especially for patient investors who take a long-term approach. The key is to find companies with strong fundamentals and good return potential.

For example, consider Lowe's Companies (LOW -0.04%). Its share price has increased by approximately 30% since it touched a 52-week low in late October. Should this big increase in just four months scare off buyers? It might be tempting to write off the stock right now, but I think Lowe's shares still offer an attractive opportunity.

An individual with a power tool fixing the oven.

Image source: Getty Images.

Strong market position

Lowe's and Home Depot (NYSE: HD) dominate the home improvement retail segment. The former has more than 1,700 stores compared to the latter's 2,300.

Size conveys certain advantages to Lowe's, including an ability to offer more competitive pricing than smaller rivals. It can also offer a wide array of services and products to individuals and professional contractors. For instance, Lowe's can subcontract work to customers, who have the assurance of the company as the contractor.

With housing sales sluggish and people having done a lot of major remodeling during the early days of the pandemic, Lowe's results have been weak lately. In its fiscal 2023 fourth quarter, which ended on Feb. 2, same-store sales (comps) fell 6.2%. That was due to softer demand among do-it-yourself customers as people turned away from spending on projects and put more of their disposable income toward lifestyle events like vacations.

But this is just business as usual for a company so closely linked to conditions in the cyclical housing market. When that market heats up, more homeowners will work on projects to get their houses ready for sale and more buyers will be sprucing up their new homes.

Collecting dividends

The retailer's results can fluctuate depending on the economic and housing cycle. Fortunately, Lowe's has built a long track record of raising its dividends in good times and bad. That should help ease the pain when tough times come.

The board of directors has increased its payouts every year for more than half a century. That puts the company in the rarefied territory of the Dividend Kings. Lowe's last announced a dividend increase in May 2023, so the announcement of the next hike could come in a couple of months.

Lowe's generates plenty of free cash flow (FCF) to support payouts. For its latest fiscal year, it generated $6.2 billion in FCF, allowing the company to easily afford the $2.5 billion in dividends it distributed. Lowe's 1.9% dividend yield at the current share price bests the S&P 500's 1.4% average yield.

Valuation

Lowe's has a better valuation than it did a year ago. The stock has a price-to-earnings (P/E) ratio of 18, down from nearly 21 last year. It's also much lower than the S&P 500's P/E of 28.

With the stock still trading at an attractive valuation despite its recent price gain, solid long-term prospects, and a board of directors committed to regularly raising dividends, you can confidently purchase Lowe's and tuck it away for the long term.