Over its history, Home Depot (HD 0.02%) has been one of the best stocks to own for so many investors. A $1,000 investment in the stock at its initial public offering in 1981 would be worth more than $1 million today. Shares are also up more than 1,000% since the Great Recession in 2008-09 and that doesn't include its growing dividend.

Last year was rough for the housing market, including Home Depot. As a result, the stock lost 24%, underperforming the S&P 500, and it is down again after its most recent earnings report was released last week. The leading home improvement retailer fell 7% last Tuesday after it missed the mark in its fourth-quarter earnings report and offered disappointing guidance.

That outlook called for flat revenue growth, and management sees earnings per share falling by mid-single digit percentages as it plans to spend $1 billion in raises for workers, or about 0.6% of annual revenue.

The forecast indicates that 2023 is likely to be challenging for Home Depot, but is the sell-off a buying opportunity? Let's look at what the stock has to offer today.

A Home Depot employee organizing an aisle.

Image source: Home Depot.

Where Home Depot is today

The home improvement sector was a big winner during the pandemic as Americans spent on renovations and other projects, and like other companies during the pandemic, Home Depot experienced a pull-forward in demand. The company grew sales by $47.2 billion over the three-year period from 2019 to 2022, a compound annual growth rate of 12.6%.

When you view the 2023 guidance in that broader context, it seems as much a reflection of the earlier pull-forward in demand as it is of macroeconomic weakness. Management also said that it expects consumer spending to continue to shift back from goods to services, weighing on the home improvement market.

Despite that short-term weakness, Home Depot continues to execute on its strategy, and spending $1 billion to raise wages is part of that as it should help improve employee retention and morale. Its digital investments helped it grow sales and gain market share, with 45% of online orders now fulfilled through stores -- a more efficient fulfillment channel than distribution centers.

Over the coming years, the company should also benefit from structural tailwinds, including the national housing shortage, which is estimated to be between 2 million and 6 million homes. That should support demand for new homes and higher prices.

American homes also continue to get bigger, and that trend is likely to accelerate with the rise of remote work, which will spur demand for home offices and extra space.

Should you buy the dip?

While 2023 is shaping up to be a challenging year for Home Depot, there are a number of reasons the stock looks attractive in the long term.

The company just raised its quarterly dividend by 10% to $2.09, reaffirming its commitment to returning capital to shareholders. It now yields 2.8%. Home Depot has steadily bought back its stock, reducing shares outstanding by a third over the last decade.

The business is also highly efficient. Management is targeting a 14.5% operating margin in 2023, and a return on invested capital of 45%. 

As the larger half of a duopoly with Lowe's, Home Depot also enjoys a number of competitive advantages: Home improvement retail has proved to be Amazon-proof, and small-footprint hardware stores and specialty retailers can't compete with the big-box chains on price or selection.

The stock is about as cheap as it's been in a decade at a price-to-earnings ratio of just 18, which is lower than the S&P 500.

Investors who buy the dip might have to be patient depending on what happens with interest rates, but buying shares of Home Depot now is likely to pay off in the long run.