Economists may have been surprised by the jump in August inflation because they were looking primarily at the cost of energy sharply declining. But consumers knew it was still costing them more to put food on the table and buy clothes, cars, and medications. So-called core costs surged almost 7% for the month and food costs spiked to 11.4%, the largest 12-month increase since 1979.

The stock market reacted to the news as you'd expect with the Dow Jones Industrial Average plummeting 1,300 points, or 4%, and the S&P 500 losing a similar percentage with just five stocks in the popular index finishing in positive territory. 

Carpenter building roof.

Image source: Getty Images.

Home Depot (HD 0.47%), which occupies a spot on both the Dow and S&P indexes, tumbled 6.5% in the aftermath as the likelihood increases that the Federal Reserve will hike interest rates by at least another 75 basis points when it meets later this month. We may be careening toward an official recession. 

Residential housing starts fell 14.4% last month, mortgage rates exceeded 6%, and 63% of small businesses are pausing the hiring of new workers, according to a survey by small business network specialist Alignable. 

It's certainly a gloomy outlook, which may have investors wondering whether they should hold off on buying the home improvement center's stock. Yet there are some very good reasons to think this may be a good time to buy Home Depot. 

Hitting close to home

A slowing economy would certainly impact Home Depot just like other retailers, as consumers prioritize spending on necessities over luxuries. Building an addition on a home might be put off until better times, and even now it hasn't been easy finding supplies and materials amid the supply chain snarls.

About 90% of Home Depot's business comes from the housing market, either directly from DIY homeowners or indirectly through professional contractors. Contractors alone represent 45% of Home Depot's total sales, so it is much more dependent on them than rival Lowe's, where they account for just 20% to 25% of revenue. 

Building for the future

And yet the housing market remains shockingly resilient thus far. Despite inflation, high energy costs, supply chain disruptions, and more, housing prices haven't collapsed. That's because there's still a high demand for houses, but a low inventory of them.

CNBC reports there's been a 27% increase in housing supply at the start of September, but inventory still remains 43% below where it was back in 2019. There will come a time when equilibrium is achieved, but we're not there yet and that's going to keep home centers active for some time.

And when people aren't buying new homes, they choose to renovate the ones they've already got, as occurred during the onset of the pandemic. They also take care of the outside of their homes, leading to more sales of gardening equipment and supplies, and paint. Indoor and outdoor gardening represents over 17% of Home Depot's total revenue, the biggest segment of all, while paint is another 7%.

Home Depot (and Lowe's, for that matter) isn't recession-proof, but it has a resiliency all its own.

Sharing profits with shareholders

And then there's Home Depot's dividend to sweeten the deal. It's made a payout to investors every year for the past 35 years, and the dividend currently yields 2.7% annually. 

Dividend stocks historically have outperformed non-paying stocks by a wide margin. Though a dividend payout is rarely going to be enough to offset a decline in capital appreciation, it's a vote of confidence in the future to keep investors from acting rashly that a company will continue sharing a percentage of its profits.

And that's why Home Depot is a buy, even if investors don't catch the exact bottom. You never know when the markets will reverse course. Over the past 20 years, the stock market went up an average of 9.5% annually, but if you missed the 10 best days in the market, your returns would be nearly cut in half to 5.3% a year.

Time in the market is more important than timing the market, and Home Depot has been a solid performer over time. Wall Street still expects it to grow earnings 16% annually, so the haircut shares have received in 2022 should be a great time to buy its stock.