2022 wasn't a good year for investors in the home improvement industry. While the wider S&P 500 was down nearly 20%, Lowe's Companies (LOW 0.22%) declined by 23%. Its larger rival, Home Depot (HD -0.60%), fell by a bit more, too, as investors worried about falling home prices, weaker demand for new homes, and reduced home improvement spending ahead.

While rising interest rates do threaten to pressure Lowe's this year, cyclical downturns are a normal part of the retailer's business. With that in mind, let's look at Lowe's and its prospects for generating solid long-term returns for investors willing to patiently ride out the current volatility.

Playing catch-up

It's likely that Lowe's will still be trailing Home Depot in key financial and growth categories in a few years. There was a steady gap through the pandemic, after all, in metrics such as market share growth, profitability, and return on invested capital. The story didn't change much in 2022, either.

Lowe's is on track to post roughly flat comparable-store sales for 2022 as operating income lands at about 13% of sales. Home Depot, in contrast, is targeting 3% higher sales and a 15.4% operating margin.

Most of that 2022 difference can be explained by Home Depot's scale and its bigger footprint with professional contractors. But Lowe's has trailed the industry leader through a wide range of selling conditions, and investors shouldn't expect that story to change in the next few years.

Always improving

The good news is that Lowe's has a solid shot at improving its core financial metrics in the coming years. Home Depot has demonstrated that it is possible, after all, to consistently achieve 15% operating margin and more than a 40% return on invested capital in this industry.

HD Return on Invested Capital Chart

HD Return on Invested Capital data by YCharts

The big wild card here is the potential for a recession, which seems likely in the home improvement industry given quickly rising mortgage rates and slowing consumer spending patterns. Still, Lowe's has navigated through several such pullbacks.

It didn't even cut its dividend during the Great Recession period that saw collapsing home prices in 2008. That success suggests Lowe's shareholders don't have to worry much about the company's financial health even if the economy takes a turn lower over the next few quarters.

Is it a buy?

Investors are being offered a big discount on Lowe's shares today. You have to pay about 1.3 times annual sales for the stock, compared with 1.8 in early 2022. Home Depot's price-to-sales ratio is a steeper 2.1, but that's also down from 3 about a year ago.

That lower valuation makes it more likely that you'll see solid returns by holding Lowe's stock for at least three years. So does the company's dividend, which is on pace to rise for a 49th consecutive year in 2023. Home Depot's streak isn't nearly as long because the industry leader paused dividend boosts during the worst of the Great Recession.

If the more conservative capital allocation style at Lowe's appeals to you, then you might consider buying the stock here in early 2023. Sure, the next few quarters could bring a few negative surprises on growth and earnings. But Lowe's is likely to be setting new profit records several years into the future. Investors' returns should follow that positive trend, too.